summaryrefslogtreecommitdiffstats
path: root/usr.bin/touch
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/touch')
-rw-r--r--usr.bin/touch/touch.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c
index d92af2d..ce2e712 100644
--- a/usr.bin/touch/touch.c
+++ b/usr.bin/touch/touch.c
@@ -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);
}
OpenPOWER on IntegriCloud