aboutsummaryrefslogtreecommitdiffstats
path: root/mac/src/mac.c
diff options
context:
space:
mode:
authorAndrew Choi2001-09-04 05:00:04 +0000
committerAndrew Choi2001-09-04 05:00:04 +0000
commit3b6944edccb31d066ca132168902858532dbe80e (patch)
treefa0cbaef7f54b1c079d404cefe2e045325c64763 /mac/src/mac.c
parentae355fa64acf5a71e6199fb3f8c3eb9fed569e8e (diff)
downloademacs-3b6944edccb31d066ca132168902858532dbe80e.tar.gz
emacs-3b6944edccb31d066ca132168902858532dbe80e.zip
2001-09-04 Andrew Choi <akochoi@cse.cuhk.edu.hk>
* src/mac.c (stat): Don't fail for aliases. (sys_open) [__MRC__]: Set file creator and type for newly-created files.
Diffstat (limited to 'mac/src/mac.c')
-rw-r--r--mac/src/mac.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/mac/src/mac.c b/mac/src/mac.c
index e588fd38fb9..0aaad884f6d 100644
--- a/mac/src/mac.c
+++ b/mac/src/mac.c
@@ -330,8 +330,8 @@ stat_noalias (const char *path, struct stat *buf)
330 if (cipb.hFileInfo.ioFlFndrInfo.fdFlags & 0x8000) 330 if (cipb.hFileInfo.ioFlFndrInfo.fdFlags & 0x8000)
331 { 331 {
332 /* identify alias files as symlinks */ 332 /* identify alias files as symlinks */
333 buf->st_mode |= S_IFLNK;
334 buf->st_mode &= ~S_IFREG; 333 buf->st_mode &= ~S_IFREG;
334 buf->st_mode |= S_IFLNK;
335 } 335 }
336 336
337 buf->st_nlink = 1; 337 buf->st_nlink = 1;
@@ -367,7 +367,8 @@ stat (const char *path, struct stat *sb)
367 char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; 367 char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1];
368 int len; 368 int len;
369 369
370 if ((result = stat_noalias (path, sb)) >= 0) 370 if ((result = stat_noalias (path, sb)) >= 0 &&
371 ! (sb->st_mode & S_IFLNK))
371 return result; 372 return result;
372 373
373 if (find_true_pathname (path, true_pathname, MAXPATHLEN+1) == -1) 374 if (find_true_pathname (path, true_pathname, MAXPATHLEN+1) == -1)
@@ -605,10 +606,14 @@ sys_open (const char *path, int oflag)
605 else 606 else
606 { 607 {
607#ifdef __MRC__ 608#ifdef __MRC__
608 if (oflag == O_WRONLY || oflag == O_RDWR) 609 int res = open (mac_pathname, oflag);
610 /* if (oflag == O_WRONLY || oflag == O_RDWR) */
611 if (oflag & O_CREAT)
609 fsetfileinfo (mac_pathname, 'EMAx', 'TEXT'); 612 fsetfileinfo (mac_pathname, 'EMAx', 'TEXT');
610#endif 613 return res;
614#else
611 return open (mac_pathname, oflag); 615 return open (mac_pathname, oflag);
616#endif
612 } 617 }
613} 618}
614 619