changeset 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 6e45d26a2555
children a53eba1d3542
files mac/ChangeLog mac/src/mac.c
diffstat 2 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mac/ChangeLog	Tue Sep 04 03:43:23 2001 +0000
+++ b/mac/ChangeLog	Tue Sep 04 05:00:04 2001 +0000
@@ -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
--- 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);
     }
 }