mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-30 05:48:18 +00:00
It is possible for tv_usec to hold >= 1000000 usecs so add in tv_usec / 1000000.
This commit is contained in:
parent
d857334e61
commit
f057686d20
8
utimes.c
8
utimes.c
@ -46,8 +46,8 @@ utimes(file, times)
|
||||
if (times != NULL) {
|
||||
struct utimbuf utb;
|
||||
|
||||
utb.actime = (time_t)times[0].tv_sec;
|
||||
utb.modtime = (time_t)times[1].tv_sec;
|
||||
utb.actime = (time_t)(times[0].tv_sec + times[0].tv_usec / 1000000);
|
||||
utb.modtime = (time_t)(times[1].tv_sec + times[1].tv_usec / 1000000);
|
||||
return(utime(file, &utb));
|
||||
} else
|
||||
return(utime(file, NULL));
|
||||
@ -66,8 +66,8 @@ futimes(fd, times)
|
||||
if (times != NULL) {
|
||||
struct utimbuf utb;
|
||||
|
||||
utb.actime = (time_t)times[0].tv_sec;
|
||||
utb.modtime = (time_t)times[1].tv_sec;
|
||||
utb.actime = (time_t)(times[0].tv_sec + times[0].tv_usec / 1000000);
|
||||
utb.modtime = (time_t)(times[1].tv_sec + times[1].tv_usec / 1000000);
|
||||
return(futime(fd, &utb));
|
||||
} else
|
||||
return(futime(fd, NULL));
|
||||
|
Loading…
x
Reference in New Issue
Block a user