Author: jh
Date: Fri Jan 20 07:29:29 2012
New Revision: 230372
URL: http://svn.freebsd.org/changeset/base/230372

Log:
  - Clean up checkpath().
  - Remove unneeded sysexits.h include.
  
  No functional change.
  
  Submitted by: bde

Modified:
  head/sbin/mount/getmntopts.c

Modified: head/sbin/mount/getmntopts.c
==============================================================================
--- head/sbin/mount/getmntopts.c        Fri Jan 20 07:02:42 2012        
(r230371)
+++ head/sbin/mount/getmntopts.c        Fri Jan 20 07:29:29 2012        
(r230372)
@@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$");
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sysexits.h>
 
 #include "mntopts.h"
 
@@ -129,14 +128,12 @@ checkpath(const char *path, char *resolv
 {
        struct stat sb;
 
-       if (realpath(path, resolved) != NULL && stat(resolved, &sb) == 0) {
-               if (!S_ISDIR(sb.st_mode)) {
-                       errno = ENOTDIR;
-                       return (1);
-               }
-       } else
+       if (realpath(path, resolved) == NULL || stat(resolved, &sb) != 0)
                return (1);
-
+       if (!S_ISDIR(sb.st_mode)) {
+               errno = ENOTDIR;
+               return (1);
+       }
        return (0);
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to