Mercurial > emacs
diff mac/src/mac.c @ 39102:9647ef27680a
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.
author | Andrew Choi <akochoi@shaw.ca> |
---|---|
date | Tue, 04 Sep 2001 05:00:04 +0000 |
parents | bd309345e7ea |
children | c56375806351 |
line wrap: on
line diff
--- a/mac/src/mac.c Tue Sep 04 03:43:23 2001 +0000 +++ b/mac/src/mac.c Tue Sep 04 05:00:04 2001 +0000 @@ -330,8 +330,8 @@ if (cipb.hFileInfo.ioFlFndrInfo.fdFlags & 0x8000) { /* identify alias files as symlinks */ + buf->st_mode &= ~S_IFREG; buf->st_mode |= S_IFLNK; - buf->st_mode &= ~S_IFREG; } buf->st_nlink = 1; @@ -367,7 +367,8 @@ char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; int len; - if ((result = stat_noalias (path, sb)) >= 0) + if ((result = stat_noalias (path, sb)) >= 0 && + ! (sb->st_mode & S_IFLNK)) return result; if (find_true_pathname (path, true_pathname, MAXPATHLEN+1) == -1) @@ -605,10 +606,14 @@ else { #ifdef __MRC__ - if (oflag == O_WRONLY || oflag == O_RDWR) + int res = open (mac_pathname, oflag); + /* if (oflag == O_WRONLY || oflag == O_RDWR) */ + if (oflag & O_CREAT) fsetfileinfo (mac_pathname, 'EMAx', 'TEXT'); + return res; +#else + return open (mac_pathname, oflag); #endif - return open (mac_pathname, oflag); } }