mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Handle directories correctly.
PR: 40801 MFC after: 5 days
This commit is contained in:
parent
2999e9faca
commit
4d01a8fb5f
1 changed files with 6 additions and 3 deletions
|
|
@ -186,8 +186,11 @@ main(argc, argv)
|
|||
continue;
|
||||
|
||||
/* Try reading/writing. */
|
||||
if (rw(*argv, &sb, fflag))
|
||||
if (!S_ISLNK(sb.st_mode) && !S_ISDIR(sb.st_mode) &&
|
||||
rw(*argv, &sb, fflag))
|
||||
rval = 1;
|
||||
else
|
||||
warn("%s", *argv);
|
||||
}
|
||||
exit(rval);
|
||||
}
|
||||
|
|
@ -312,8 +315,8 @@ rw(fname, sbp, force)
|
|||
int fd, needed_chmod, rval;
|
||||
u_char byte;
|
||||
|
||||
/* Try regular files and directories. */
|
||||
if (!S_ISREG(sbp->st_mode) && !S_ISDIR(sbp->st_mode)) {
|
||||
/* Try regular files. */
|
||||
if (!S_ISREG(sbp->st_mode)) {
|
||||
warnx("%s: %s", fname, strerror(EFTYPE));
|
||||
return (1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue