summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Choi <akochoi@shaw.ca>2001-09-04 05:00:04 +0000
committerAndrew Choi <akochoi@shaw.ca>2001-09-04 05:00:04 +0000
commit3b6944edccb31d066ca132168902858532dbe80e (patch)
treefa0cbaef7f54b1c079d404cefe2e045325c64763
parentae355fa64acf5a71e6199fb3f8c3eb9fed569e8e (diff)
downloademacs-3b6944edccb31d066ca132168902858532dbe80e.tar.gz
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.
-rw-r--r--mac/ChangeLog6
-rw-r--r--mac/src/mac.c13
2 files changed, 15 insertions, 4 deletions
diff --git a/mac/ChangeLog b/mac/ChangeLog
index 4030043afc9..8de7ed99e00 100644
--- a/mac/ChangeLog
+++ b/mac/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2001-08-24 Andrew Choi <akochoi@cse.cuhk.edu.hk>
* src/macterm.c (init_font_name_table): Add an additional entry to
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)
if (cipb.hFileInfo.ioFlFndrInfo.fdFlags & 0x8000)
{
/* identify alias files as symlinks */
- buf->st_mode |= S_IFLNK;
buf->st_mode &= ~S_IFREG;
+ buf->st_mode |= S_IFLNK;
}
buf->st_nlink = 1;
@@ -367,7 +367,8 @@ stat (const char *path, struct stat *sb)
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 @@ sys_open (const char *path, int oflag)
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');
-#endif
+ return res;
+#else
return open (mac_pathname, oflag);
+#endif
}
}