X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fsysdep.c;h=e327cff19e374f5d70ee552201d62584a36c098a;hb=1cc5b779cb8755e01e02aead4fba711c06158b90;hp=12cd3de538f60532e574f568a798756fb352ab70;hpb=0c693dc08f0794304711787b2eb47c144ea4bef1;p=chise%2Fxemacs-chise.git diff --git a/src/sysdep.c b/src/sysdep.c index 12cd3de..e327cff 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -140,22 +140,6 @@ static void hft_reset (struct console *c); #include #endif -/* ------------------------------- */ -/* miscellaneous */ -/* ------------------------------- */ - -#ifndef HAVE_UTIMES -#ifndef HAVE_STRUCT_UTIMBUF -/* We want to use utime rather than utimes, but we couldn't find the - structure declaration. We'll use the traditional one. */ -struct utimbuf -{ - long actime; - long modtime; -}; -#endif -#endif - /************************************************************************/ /* subprocess control */ @@ -3364,17 +3348,20 @@ gettimeofday (struct timeval *tp, struct timezone *tzp) int set_file_times (char *filename, EMACS_TIME atime, EMACS_TIME mtime) { -#ifdef HAVE_UTIMES - struct timeval tv[2]; - tv[0] = atime; - tv[1] = mtime; - return utimes (filename, tv); -#else /* not HAVE_UTIMES */ +#if defined (HAVE_UTIME) struct utimbuf utb; utb.actime = EMACS_SECS (atime); utb.modtime = EMACS_SECS (mtime); return utime (filename, &utb); -#endif /* not HAVE_UTIMES */ +#elif defined (HAVE_UTIMES) + struct timeval tv[2]; + tv[0] = atime; + tv[1] = mtime; + return utimes (filename, tv); +#else + /* No file times setting function available. */ + return -1; +#endif } /* */