Hey folks,

In file-utimes.c the port existence is only verified after some
computations on the atime and mtime timespec's are done. That is
unnecessary when we exit with EOPNOTSUPP. This patches just changes
the order of the check.

Index: file-utimes.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libnetfs/file-utimes.c,v
retrieving revision 1.6
diff -u -r1.6 file-utimes.c
--- file-utimes.c       31 Jan 1999 23:49:54 -0000      1.6
+++ file-utimes.c       29 Jun 2008 23:21:11 -0000
@@ -29,6 +29,9 @@
   struct timespec atime, mtime;
   error_t err;

+  if (!user)
+    return EOPNOTSUPP;
+
   if (atimein.microseconds != -1)
     {
       atime.tv_sec = atimein.seconds;
@@ -41,9 +44,6 @@
       mtime.tv_nsec = mtimein.microseconds * 1000;
     }

-  if (!user)
-    return EOPNOTSUPP;
-
   mutex_lock (&user->po->np->lock);
   err = netfs_attempt_utimes (user->user, user->po->np,
                              atimein.microseconds != -1 ? &atime : 0,


Flávio.
Index: file-utimes.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libnetfs/file-utimes.c,v
retrieving revision 1.6
diff -u -r1.6 file-utimes.c
--- file-utimes.c	31 Jan 1999 23:49:54 -0000	1.6
+++ file-utimes.c	29 Jun 2008 23:21:11 -0000
@@ -29,6 +29,9 @@
   struct timespec atime, mtime;
   error_t err;
 
+  if (!user)
+    return EOPNOTSUPP;
+
   if (atimein.microseconds != -1)
     {
       atime.tv_sec = atimein.seconds;
@@ -41,9 +44,6 @@
       mtime.tv_nsec = mtimein.microseconds * 1000;
     }
   
-  if (!user)
-    return EOPNOTSUPP;
-  
   mutex_lock (&user->po->np->lock);
   err = netfs_attempt_utimes (user->user, user->po->np, 
 			      atimein.microseconds != -1 ? &atime : 0, 

Reply via email to