소스 검색

fix futimes legacy function with null tv pointer

a null pointer is valid here and indicates that the current time
should be used. based on patch by Felix Janda, simplified.
Rich Felker 9 년 전
부모
커밋
ece0c48a60
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/legacy/futimes.c

+ 1 - 0
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;