comparison src/sysdep.c @ 8934:e743d2957399

(set_file_times): Move this out of the USG conditional.
author Karl Heuer <kwzh@gnu.org>
date Tue, 20 Sep 1994 04:07:48 +0000
parents 754325dc4ed7
children fd91a0b1e333
comparison
equal deleted inserted replaced
8933:f060ee7326c5 8934:e743d2957399
3021 return (-1); 3021 return (-1);
3022 } 3022 }
3023 3023
3024 #endif 3024 #endif
3025 3025
3026 int
3027 set_file_times (path, atime, mtime)
3028 char *path;
3029 EMACS_TIME atime, mtime;
3030 {
3031 #ifdef HAVE_UTIMES
3032 struct timeval tv[2];
3033 tv[0] = atime;
3034 tv[1] = mtime;
3035 return utimes (path, tv);
3036 #else
3037 #ifdef HAVE_UTIME
3038 #ifndef HAVE_STRUCT_UTIMBUF
3039 struct utimbuf {
3040 long actime;
3041 long modtime;
3042 };
3043 #endif
3044 struct utimbuf utb;
3045 utb.actime = EMACS_SECS (atime);
3046 utb.modtime = EMACS_SECS (mtime);
3047 return utime (path, &utb);
3048 #else /* !HAVE_UTIMES && !HAVE_UTIME */
3049 /* Should we set errno here? If so, set it to what? */
3050 return -1;
3051 #endif
3052 #endif
3053 }
3054
3055 3026
3056 #ifdef HPUX 3027 #ifdef HPUX
3057 #ifndef HAVE_PERROR 3028 #ifndef HAVE_PERROR
3058 3029
3059 /* HPUX curses library references perror, but as far as we know 3030 /* HPUX curses library references perror, but as far as we know
3389 #endif /* VMS */ 3360 #endif /* VMS */
3390 3361
3391 #endif /* NONSYSTEM_DIR_LIBRARY */ 3362 #endif /* NONSYSTEM_DIR_LIBRARY */
3392 3363
3393 3364
3365 int
3366 set_file_times (path, atime, mtime)
3367 char *path;
3368 EMACS_TIME atime, mtime;
3369 {
3370 #ifdef HAVE_UTIMES
3371 struct timeval tv[2];
3372 tv[0] = atime;
3373 tv[1] = mtime;
3374 return utimes (path, tv);
3375 #else
3376 #ifdef HAVE_UTIME
3377 #ifndef HAVE_STRUCT_UTIMBUF
3378 struct utimbuf {
3379 long actime;
3380 long modtime;
3381 };
3382 #endif
3383 struct utimbuf utb;
3384 utb.actime = EMACS_SECS (atime);
3385 utb.modtime = EMACS_SECS (mtime);
3386 return utime (path, &utb);
3387 #else /* !HAVE_UTIMES && !HAVE_UTIME */
3388 /* Should we set errno here? If so, set it to what? */
3389 return -1;
3390 #endif
3391 #endif
3392 }
3393
3394 /* mkdir and rmdir functions, for systems which don't have them. */ 3394 /* mkdir and rmdir functions, for systems which don't have them. */
3395 3395
3396 #ifndef HAVE_MKDIR 3396 #ifndef HAVE_MKDIR
3397 /* 3397 /*
3398 * Written by Robert Rother, Mariah Corporation, August 1985. 3398 * Written by Robert Rother, Mariah Corporation, August 1985.