diff options
| author | Jim Blandy | 1992-02-23 10:18:09 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-02-23 10:18:09 +0000 |
| commit | de5bf5d31ab7d78113e17e19c794be3f46c744c2 (patch) | |
| tree | 19354de05766a1de6db33ea6a182ba96992efe21 /src | |
| parent | 9ab9afa99b0c9b1c1d4f6314914978680969521d (diff) | |
| download | emacs-de5bf5d31ab7d78113e17e19c794be3f46c744c2.tar.gz emacs-de5bf5d31ab7d78113e17e19c794be3f46c744c2.zip | |
*** empty log message ***
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/src/fileio.c b/src/fileio.c index b12f48c625a..cc8ef43eb21 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -22,7 +22,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 22 | #include <sys/stat.h> | 22 | #include <sys/stat.h> |
| 23 | 23 | ||
| 24 | #ifdef VMS | 24 | #ifdef VMS |
| 25 | #include "pwd.h" | 25 | #include "vms-pwd.h" |
| 26 | #else | 26 | #else |
| 27 | #include <pwd.h> | 27 | #include <pwd.h> |
| 28 | #endif | 28 | #endif |
| @@ -64,13 +64,7 @@ extern int sys_nerr; | |||
| 64 | #include <nam.h> | 64 | #include <nam.h> |
| 65 | #endif | 65 | #endif |
| 66 | 66 | ||
| 67 | #ifdef NEED_TIME_H | 67 | #include "systime.h" |
| 68 | #include <time.h> | ||
| 69 | #else /* not NEED_TIME_H */ | ||
| 70 | #ifdef HAVE_TIMEVAL | ||
| 71 | #include <sys/time.h> | ||
| 72 | #endif /* HAVE_TIMEVAL */ | ||
| 73 | #endif /* not NEED_TIME_H */ | ||
| 74 | 68 | ||
| 75 | #ifdef HPUX | 69 | #ifdef HPUX |
| 76 | #include <netio.h> | 70 | #include <netio.h> |
| @@ -1417,33 +1411,17 @@ A prefix arg makes KEEP-TIME non-nil.") | |||
| 1417 | 1411 | ||
| 1418 | if (fstat (ifd, &st) >= 0) | 1412 | if (fstat (ifd, &st) >= 0) |
| 1419 | { | 1413 | { |
| 1420 | #ifdef HAVE_TIMEVAL | ||
| 1421 | if (!NILP (keep_date)) | 1414 | if (!NILP (keep_date)) |
| 1422 | { | 1415 | { |
| 1423 | #ifdef USE_UTIME | 1416 | EMACS_TIME atime, mtime; |
| 1424 | /* AIX has utimes() in compatibility package, but it dies. So use good old | 1417 | EMACS_SET_SECS_USECS (atime, st.st_atime, 0); |
| 1425 | utime interface instead. */ | 1418 | EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); |
| 1426 | struct { | 1419 | EMACS_SET_UTIMES (XSTRING (newname)->data, atime, mtime); |
| 1427 | time_t atime; | ||
| 1428 | time_t mtime; | ||
| 1429 | } tv; | ||
| 1430 | tv.atime = st.st_atime; | ||
| 1431 | tv.mtime = st.st_mtime; | ||
| 1432 | utime (XSTRING (newname)->data, &tv); | ||
| 1433 | #else /* not USE_UTIME */ | ||
| 1434 | struct timeval timevals[2]; | ||
| 1435 | timevals[0].tv_sec = st.st_atime; | ||
| 1436 | timevals[1].tv_sec = st.st_mtime; | ||
| 1437 | timevals[0].tv_usec = timevals[1].tv_usec = 0; | ||
| 1438 | utimes (XSTRING (newname)->data, timevals); | ||
| 1439 | #endif /* not USE_UTIME */ | ||
| 1440 | } | 1420 | } |
| 1441 | #endif /* HAVE_TIMEVALS */ | ||
| 1442 | |||
| 1443 | #ifdef APOLLO | 1421 | #ifdef APOLLO |
| 1444 | if (!egetenv ("USE_DOMAIN_ACLS")) | 1422 | if (!egetenv ("USE_DOMAIN_ACLS")) |
| 1445 | #endif | 1423 | #endif |
| 1446 | chmod (XSTRING (newname)->data, st.st_mode & 07777); | 1424 | chmod (XSTRING (newname)->data, st.st_mode & 07777); |
| 1447 | } | 1425 | } |
| 1448 | 1426 | ||
| 1449 | close (ifd); | 1427 | close (ifd); |