浏览代码

utime.c,utimes.c: include headers only when needed

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Peter S. Mazinger 14 年之前
父节点
当前提交
8f1ba5cd4f
共有 2 个文件被更改,包括 6 次插入8 次删除
  1. 3 4
      libc/sysdeps/linux/common/utime.c
  2. 3 4
      libc/sysdeps/linux/common/utimes.c

+ 3 - 4
libc/sysdeps/linux/common/utime.c

@@ -10,13 +10,12 @@
 #include <sys/syscall.h>
 #include <sys/syscall.h>
 #include <utime.h>
 #include <utime.h>
 
 
-
 #ifdef __NR_utime
 #ifdef __NR_utime
 _syscall2(int, utime, const char *, file, const struct utimbuf *, times)
 _syscall2(int, utime, const char *, file, const struct utimbuf *, times)
 #else
 #else
-#include <stdlib.h>
+# define __need_NULL
-#include <sys/time.h>
+# include <stddef.h>
-
+# include <sys/time.h>
 
 
 int utime(const char *file, const struct utimbuf *times)
 int utime(const char *file, const struct utimbuf *times)
 {
 {

+ 3 - 4
libc/sysdeps/linux/common/utimes.c

@@ -8,15 +8,14 @@
  */
  */
 
 
 #include <sys/syscall.h>
 #include <sys/syscall.h>
-#include <utime.h>
 #include <sys/time.h>
 #include <sys/time.h>
 
 
-
 #ifdef __NR_utimes
 #ifdef __NR_utimes
 _syscall2(int, utimes, const char *, file, const struct timeval *, tvp)
 _syscall2(int, utimes, const char *, file, const struct timeval *, tvp)
 #else
 #else
-#include <stdlib.h>
+# define __need_NULL
-
+# include <stddef.h>
+# include <utime.h>
 
 
 int utimes(const char *file, const struct timeval tvp[2])
 int utimes(const char *file, const struct timeval tvp[2])
 {
 {