diff options
| author | Richard M. Stallman | 1995-05-03 20:27:05 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-05-03 20:27:05 +0000 |
| commit | 125feee8d66087a173d898135fd99c2a71900498 (patch) | |
| tree | 0366d4ce2c51a5ff339b2235d2889dcd106aeb5e /src | |
| parent | 774271716c7fe28a9cd386d475966c75f6f3496a (diff) | |
| download | emacs-125feee8d66087a173d898135fd99c2a71900498.tar.gz emacs-125feee8d66087a173d898135fd99c2a71900498.zip | |
(directory_file_name): Add APOLLO conditional.
(Fcopy_file, Fset_file_modes): Delete APOLLO conditionals.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/src/fileio.c b/src/fileio.c index 3c4ed563fb0..9222f8442a0 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -650,10 +650,17 @@ directory_file_name (src, dst) | |||
| 650 | /* Process as Unix format: just remove any final slash. | 650 | /* Process as Unix format: just remove any final slash. |
| 651 | But leave "/" unchanged; do not change it to "". */ | 651 | But leave "/" unchanged; do not change it to "". */ |
| 652 | strcpy (dst, src); | 652 | strcpy (dst, src); |
| 653 | #ifdef APOLLO | ||
| 654 | /* Handle // as root for apollo's. */ | ||
| 655 | if ((slen > 2 && dst[slen - 1] == '/') | ||
| 656 | || (slen > 1 && dst[0] != '/' && dst[slen - 1] == '/')) | ||
| 657 | dst[slen - 1] = 0; | ||
| 658 | #else | ||
| 653 | if (slen > 1 | 659 | if (slen > 1 |
| 654 | && IS_DIRECTORY_SEP (dst[slen - 1]) | 660 | && IS_DIRECTORY_SEP (dst[slen - 1]) |
| 655 | && !IS_ANY_SEP (dst[slen - 2])) | 661 | && !IS_ANY_SEP (dst[slen - 2])) |
| 656 | dst[slen - 1] = 0; | 662 | dst[slen - 1] = 0; |
| 663 | #endif | ||
| 657 | return 1; | 664 | return 1; |
| 658 | } | 665 | } |
| 659 | 666 | ||
| @@ -1900,9 +1907,6 @@ A prefix arg makes KEEP-TIME non-nil.") | |||
| 1900 | if (set_file_times (XSTRING (newname)->data, atime, mtime)) | 1907 | if (set_file_times (XSTRING (newname)->data, atime, mtime)) |
| 1901 | report_file_error ("I/O error", Fcons (newname, Qnil)); | 1908 | report_file_error ("I/O error", Fcons (newname, Qnil)); |
| 1902 | } | 1909 | } |
| 1903 | #ifdef APOLLO | ||
| 1904 | if (!egetenv ("USE_DOMAIN_ACLS")) | ||
| 1905 | #endif | ||
| 1906 | chmod (XSTRING (newname)->data, st.st_mode & 07777); | 1910 | chmod (XSTRING (newname)->data, st.st_mode & 07777); |
| 1907 | } | 1911 | } |
| 1908 | 1912 | ||
| @@ -2591,36 +2595,8 @@ Only the 12 low bits of MODE are used.") | |||
| 2591 | if (!NILP (handler)) | 2595 | if (!NILP (handler)) |
| 2592 | return call3 (handler, Qset_file_modes, abspath, mode); | 2596 | return call3 (handler, Qset_file_modes, abspath, mode); |
| 2593 | 2597 | ||
| 2594 | #ifndef APOLLO | ||
| 2595 | if (chmod (XSTRING (abspath)->data, XINT (mode)) < 0) | 2598 | if (chmod (XSTRING (abspath)->data, XINT (mode)) < 0) |
| 2596 | report_file_error ("Doing chmod", Fcons (abspath, Qnil)); | 2599 | report_file_error ("Doing chmod", Fcons (abspath, Qnil)); |
| 2597 | #else /* APOLLO */ | ||
| 2598 | if (!egetenv ("USE_DOMAIN_ACLS")) | ||
| 2599 | { | ||
| 2600 | struct stat st; | ||
| 2601 | struct timeval tvp[2]; | ||
| 2602 | |||
| 2603 | /* chmod on apollo also change the file's modtime; need to save the | ||
| 2604 | modtime and then restore it. */ | ||
| 2605 | if (stat (XSTRING (abspath)->data, &st) < 0) | ||
| 2606 | { | ||
| 2607 | report_file_error ("Doing chmod", Fcons (abspath, Qnil)); | ||
| 2608 | return (Qnil); | ||
| 2609 | } | ||
| 2610 | |||
| 2611 | if (chmod (XSTRING (abspath)->data, XINT (mode)) < 0) | ||
| 2612 | report_file_error ("Doing chmod", Fcons (abspath, Qnil)); | ||
| 2613 | |||
| 2614 | /* reset the old accessed and modified times. */ | ||
| 2615 | tvp[0].tv_sec = st.st_atime + 1; /* +1 due to an Apollo roundoff bug */ | ||
| 2616 | tvp[0].tv_usec = 0; | ||
| 2617 | tvp[1].tv_sec = st.st_mtime + 1; /* +1 due to an Apollo roundoff bug */ | ||
| 2618 | tvp[1].tv_usec = 0; | ||
| 2619 | |||
| 2620 | if (utimes (XSTRING (abspath)->data, tvp) < 0) | ||
| 2621 | report_file_error ("Doing utimes", Fcons (abspath, Qnil)); | ||
| 2622 | } | ||
| 2623 | #endif /* APOLLO */ | ||
| 2624 | 2600 | ||
| 2625 | return Qnil; | 2601 | return Qnil; |
| 2626 | } | 2602 | } |