Alexandre Julliard : ntdll: Remove unnecessary pointers in fstab parsing on Solaris.

Alexandre Julliard julliard at wine.codeweavers.com
Sat Mar 17 14:35:30 CDT 2007


Module: wine
Branch: master
Commit: b2c985697fa1fcff7b7a160291bdf18e25d66955
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b2c985697fa1fcff7b7a160291bdf18e25d66955

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sat Mar 17 20:07:10 2007 +0100

ntdll: Remove unnecessary pointers in fstab parsing on Solaris.

---

 dlls/ntdll/directory.c |   40 ++++++++++++++++++----------------------
 1 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index c0933bc..66547b5 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -236,24 +236,22 @@ static char *get_default_lpt_device( int num )
 #include <sys/vfstab.h>
 static char *parse_vfstab_entries( FILE *f, dev_t dev, ino_t ino)
 {
-
-    struct vfstab vfs_entry;
-    struct vfstab *entry=&vfs_entry;
+    struct vfstab entry;
     struct stat st;
     char *device;
 
-    while (! getvfsent( f, entry ))
+    while (! getvfsent( f, &entry ))
     {
         /* don't even bother stat'ing network mounts, there's no meaningful device anyway */
-        if (!strcmp( entry->vfs_fstype, "nfs" ) ||
-            !strcmp( entry->vfs_fstype, "smbfs" ) ||
-            !strcmp( entry->vfs_fstype, "ncpfs" )) continue;
+        if (!strcmp( entry.vfs_fstype, "nfs" ) ||
+            !strcmp( entry.vfs_fstype, "smbfs" ) ||
+            !strcmp( entry.vfs_fstype, "ncpfs" )) continue;
 
-        if (stat( entry->vfs_mountp, &st ) == -1) continue;
+        if (stat( entry.vfs_mountp, &st ) == -1) continue;
         if (st.st_dev != dev || st.st_ino != ino) continue;
-        if (!strcmp( entry->vfs_fstype, "fd" ))
+        if (!strcmp( entry.vfs_fstype, "fd" ))
         {
-            if ((device = strstr( entry->vfs_mntopts, "dev=" )))
+            if ((device = strstr( entry.vfs_mntopts, "dev=" )))
             {
                 char *p = strchr( device + 4, ',' );
                 if (p) *p = 0;
@@ -261,7 +259,7 @@ static char *parse_vfstab_entries( FILE *f, dev_t dev, ino_t ino)
             }
         }
         else
-            return entry->vfs_special;
+            return entry.vfs_special;
     }
     return NULL;
 }
@@ -335,25 +333,23 @@ static char *parse_mount_entries( FILE *f, dev_t dev, ino_t ino )
 #include <sys/mnttab.h>
 static char *parse_mount_entries( FILE *f, dev_t dev, ino_t ino )
 {
-
-    volatile struct mnttab mntentry;
-    struct mnttab *entry=&mntentry;
+    struct mnttab entry;
     struct stat st;
     char *device;
 
 
-    while (( ! getmntent( f , entry) ))
+    while (( ! getmntent( f, &entry) ))
     {
         /* don't even bother stat'ing network mounts, there's no meaningful device anyway */
-        if (!strcmp( entry->mnt_fstype, "nfs" ) ||
-            !strcmp( entry->mnt_fstype, "smbfs" ) ||
-            !strcmp( entry->mnt_fstype, "ncpfs" )) continue;
+        if (!strcmp( entry.mnt_fstype, "nfs" ) ||
+            !strcmp( entry.mnt_fstype, "smbfs" ) ||
+            !strcmp( entry.mnt_fstype, "ncpfs" )) continue;
 
-        if (stat( entry->mnt_mountp, &st ) == -1) continue;
+        if (stat( entry.mnt_mountp, &st ) == -1) continue;
         if (st.st_dev != dev || st.st_ino != ino) continue;
-        if (!strcmp( entry->mnt_fstype, "fd" ))
+        if (!strcmp( entry.mnt_fstype, "fd" ))
         {
-            if ((device = strstr( entry->mnt_mntopts, "dev=" )))
+            if ((device = strstr( entry.mnt_mntopts, "dev=" )))
             {
                 char *p = strchr( device + 4, ',' );
                 if (p) *p = 0;
@@ -361,7 +357,7 @@ static char *parse_mount_entries( FILE *f, dev_t dev, ino_t ino )
             }
         }
         else
-            return entry->mnt_special;
+            return entry.mnt_special;
     }
     return NULL;
 }




More information about the wine-cvs mailing list