if (!statfailed && (statbuf.st_mode & 0000111))
return (qualify(fn));
else if (statfailed && errno != ENOENT && errno != ENOTDIR &&
- errno != EINVAL) {
+ errno != EINVAL)
perror("find_path: stat");
- exit(1);
- }
+
path = n + 1;
} while (n);
statfailed = stat(fn, &statbuf);
if (!statfailed && (statbuf.st_mode & 0000111))
return (qualify(fn));
- else if (statfailed && errno != ENOENT && errno != ENOTDIR) {
+ else if (statfailed && errno != ENOENT && errno != ENOTDIR &&
+ errno != EINVAL) {
perror("find_path: stat");
- exit(1);
+ return (NULL);
}
}
return (NULL);
* is it a bogus path?
*/
if (stat(n, &statbuf)) {
- if (errno == ENOENT)
- return (NULL);
- else {
+ if (errno != ENOENT)
perror("qualify: stat");
- exit(1);
- }
+ return (NULL);
}
/*
*/
if (lstat(full, &statbuf)) {
perror("qualify: lstat");
- exit(1);
+ return (NULL);
}
if ((statbuf.st_mode & S_IFMT) == S_IFLNK) {