Skip to content

Commit

Permalink
Fix CTimeVal definition for platforms where time_t isn't CLong
Browse files Browse the repository at this point in the history
One such platform is Debian unstable armhf, which is in the process of
transitioning to 64-bit time_t: https://wiki.debian.org/ReleaseGoals/64bit-time

On that platform (as well as any other glibc/musl platform), however,
CTimeVal isn't used for anything at all because there are #ifdefs that
prefer using `utimensat` which takes CTimeSpec instead. This fix is
therefore quite theoretical, as it is unknown whether there are any
platforms actually affected.

Related: #252
  • Loading branch information
liskin committed Apr 30, 2024
1 parent 69552a5 commit 1cbf29d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion System/Posix/Files/Common.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ foreign import capi unsafe "sys/stat.h futimens"
c_futimens :: CInt -> Ptr CTimeSpec -> IO CInt
#endif

data CTimeVal = CTimeVal CLong CLong
data CTimeVal = CTimeVal (#type time_t) (#type suseconds_t)

instance Storable CTimeVal where
sizeOf _ = #size struct timeval
Expand Down

0 comments on commit 1cbf29d

Please sign in to comment.