comparison src/sysdep.c @ 8881:754325dc4ed7

(set_file_times): New function.
author Karl Heuer <kwzh@gnu.org>
date Sun, 18 Sep 1994 19:13:39 +0000
parents 097fe97274e9
children e743d2957399
comparison
equal deleted inserted replaced
8880:289ed00d26a9 8881:754325dc4ed7
3021 return (-1); 3021 return (-1);
3022 } 3022 }
3023 3023
3024 #endif 3024 #endif
3025 3025
3026 #ifdef MISSING_UTIMES 3026 int
3027 3027 set_file_times (path, atime, mtime)
3028 /* HPUX (among others) sets HAVE_TIMEVAL but does not implement utimes. */ 3028 char *path;
3029 3029 EMACS_TIME atime, mtime;
3030 utimes () 3030 {
3031 { 3031 #ifdef HAVE_UTIMES
3032 } 3032 struct timeval tv[2];
3033 #endif 3033 tv[0] = atime;
3034 3034 tv[1] = mtime;
3035 #ifdef IRIS_UTIME 3035 return utimes (path, tv);
3036 3036 #else
3037 /* The IRIS (3.5) has timevals, but uses sys V utime, and doesn't have the 3037 #ifdef HAVE_UTIME
3038 utimbuf structure defined anywhere but in the man page. */ 3038 #ifndef HAVE_STRUCT_UTIMBUF
3039 3039 struct utimbuf {
3040 struct utimbuf 3040 long actime;
3041 { 3041 long modtime;
3042 long actime; 3042 };
3043 long modtime; 3043 #endif
3044 };
3045
3046 utimes (name, tvp)
3047 char *name;
3048 struct timeval tvp[];
3049 {
3050 struct utimbuf utb; 3044 struct utimbuf utb;
3051 utb.actime = tvp[0].tv_sec; 3045 utb.actime = EMACS_SECS (atime);
3052 utb.modtime = tvp[1].tv_sec; 3046 utb.modtime = EMACS_SECS (mtime);
3053 utime (name, &utb); 3047 return utime (path, &utb);
3054 } 3048 #else /* !HAVE_UTIMES && !HAVE_UTIME */
3055 #endif /* IRIS_UTIME */ 3049 /* Should we set errno here? If so, set it to what? */
3050 return -1;
3051 #endif
3052 #endif
3053 }
3056 3054
3057 3055
3058 #ifdef HPUX 3056 #ifdef HPUX
3059 #ifndef HAVE_PERROR 3057 #ifndef HAVE_PERROR
3060 3058