lib/defines.h: Use 'time_t' for DAY

Special care has to be taken for 32 bit systems with a 64 bit time_t,
since their long data type is still 32 bit.

Since this macro expresses a number of seconds, and seconds are in units
of 'time_t' in C, the appropriate type for the multiplication is
'time_t'.

Reported-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2023-12-20 17:56:32 +01:00
committed by Serge Hallyn
parent ca6425e54e
commit 0ee79295f6
+1 -1
View File
@@ -144,7 +144,7 @@
/* Solaris defines this in shadow.h */
#ifndef DAY
#define DAY (24L*3600L)
#define DAY ((time_t) 24 * 3600)
#endif
#define WEEK (7*DAY)