diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2011-04-16 14:24:38 +0200 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2012-06-15 14:00:40 +0200 |
commit | 917176e71ef901297e420bbb0db99be5e8100fc3 (patch) | |
tree | 9e55d42ae33445f8f0d44995cac5fedea8f51809 /libc/sysdeps | |
parent | 4dcfe3b2699fc2bb360ece726896de798d077694 (diff) |
utime[s]: avoid circular dependency
utime.c: fix a cast, tv_sec is of type time_t
Add stub for utimes.
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/sysdeps')
-rw-r--r-- | libc/sysdeps/linux/common/utime.c | 8 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/utimes.c | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/libc/sysdeps/linux/common/utime.c b/libc/sysdeps/linux/common/utime.c index 2573e00eb..ab63a24b2 100644 --- a/libc/sysdeps/linux/common/utime.c +++ b/libc/sysdeps/linux/common/utime.c @@ -12,7 +12,7 @@ #ifdef __NR_utime _syscall2(int, utime, const char *, file, const struct utimbuf *, times) -#else +#elif defined __NR_utimes /* alpha || ia64 */ # define __need_NULL # include <stddef.h> # include <sys/time.h> @@ -24,11 +24,13 @@ int utime(const char *file, const struct utimbuf *times) if (times != NULL) { timevals[0].tv_usec = 0L; timevals[1].tv_usec = 0L; - timevals[0].tv_sec = (long int) times->actime; - timevals[1].tv_sec = (long int) times->modtime; + timevals[0].tv_sec = (time_t) times->actime; + timevals[1].tv_sec = (time_t) times->modtime; } return utimes(file, times ? timevals : NULL); } #endif +#if defined __NR_utime || defined __NR_utimes link_warning(utime, "the use of OBSOLESCENT `utime' is discouraged, use `utimes'") libc_hidden_def(utime) +#endif diff --git a/libc/sysdeps/linux/common/utimes.c b/libc/sysdeps/linux/common/utimes.c index ac9aff53d..5d6f1689c 100644 --- a/libc/sysdeps/linux/common/utimes.c +++ b/libc/sysdeps/linux/common/utimes.c @@ -12,7 +12,7 @@ #ifdef __NR_utimes _syscall2(int, utimes, const char *, file, const struct timeval *, tvp) -#else +#elif defined __NR_utime # define __need_NULL # include <stddef.h> # include <utime.h> @@ -31,4 +31,6 @@ int utimes(const char *file, const struct timeval tvp[2]) return utime(file, times); } #endif +#if defined __NR_utimes || defined __NR_utime libc_hidden_def(utimes) +#endif |