projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
484194d
)
fix futimes legacy function with null tv pointer
author
Rich Felker
<dalias@aerifal.cx>
Wed, 6 May 2015 22:53:22 +0000
(18:53 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Wed, 6 May 2015 22:53:22 +0000
(18:53 -0400)
a null pointer is valid here and indicates that the current time
should be used. based on patch by Felix Janda, simplified.
src/legacy/futimes.c
patch
|
blob
|
history
diff --git
a/src/legacy/futimes.c
b/src/legacy/futimes.c
index d81d83a962a8675a2dd74c6717d4c21828093a9d..1c19eb1fa1da143049229b32d474ce2680876f5f 100644
(file)
--- a/
src/legacy/futimes.c
+++ b/
src/legacy/futimes.c
@@
-5,6
+5,7
@@
int futimes(int fd, const struct timeval tv[2])
{
struct timespec times[2];
+ if (!tv) return futimens(fd, 0);
times[0].tv_sec = tv[0].tv_sec;
times[0].tv_nsec = tv[0].tv_usec * 1000;
times[1].tv_sec = tv[1].tv_sec;