Переглянути джерело

fix from blackfin repo: Jie Zhang writes: Passing NULL as the second argument to utimes () if the second argument to utime () is NULL as the kernel will take care of getting/setting current time

Mike Frysinger 17 роки тому
батько
коміт
f57dbfbd37
1 змінених файлів з 1 додано та 6 видалено
  1. 1 6
      libc/sysdeps/linux/common/utime.c

+ 1 - 6
libc/sysdeps/linux/common/utime.c

@@ -30,13 +30,8 @@ int utime(const char *file, const struct utimbuf *times)
 		timevals[1].tv_usec = 0L;
 		timevals[0].tv_sec = (long int) times->actime;
 		timevals[1].tv_sec = (long int) times->modtime;
-	} else {
-		if (gettimeofday(&timevals[0], NULL) < 0) {
-			return -1;
-		}
-		timevals[1] = timevals[0];
 	}
-	return utimes(file, timevals);
+	return utimes(file, times ? timevals : NULL);
 }
 #endif
 libc_hidden_def(utime)