diff options
author | jh <jh@FreeBSD.org> | 2012-01-20 07:29:29 +0000 |
---|---|---|
committer | jh <jh@FreeBSD.org> | 2012-01-20 07:29:29 +0000 |
commit | e6f0693c66f91a339f459a393b7d37504309e7fb (patch) | |
tree | 1749c91468413e9e15f995b4e1f49e707be9e004 /sbin/mount | |
parent | c5a288abe2784e17d67b62a46384f3911a659f43 (diff) | |
download | FreeBSD-src-e6f0693c66f91a339f459a393b7d37504309e7fb.zip FreeBSD-src-e6f0693c66f91a339f459a393b7d37504309e7fb.tar.gz |
- Clean up checkpath().
- Remove unneeded sysexits.h include.
No functional change.
Submitted by: bde
Diffstat (limited to 'sbin/mount')
-rw-r--r-- | sbin/mount/getmntopts.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sbin/mount/getmntopts.c b/sbin/mount/getmntopts.c index 3503060..f8a3453 100644 --- a/sbin/mount/getmntopts.c +++ b/sbin/mount/getmntopts.c @@ -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 *resolved) { 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); } |