fts(3) now sets errno correctly, FTS_DNX no longer exists
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 13 Mar 1991 00:44:21 +0000 (16:44 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 13 Mar 1991 00:44:21 +0000 (16:44 -0800)
SCCS-vsn: bin/chmod/chmod.c 5.19

usr/src/bin/chmod/chmod.c

index 20fcc53..f0d9419 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)chmod.c    5.18 (Berkeley) %G%";
+static char sccsid[] = "@(#)chmod.c    5.19 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -82,28 +82,14 @@ done:       argv += optind;
                }
                while (p = fts_read(fts))
                        switch(p->fts_info) {
                }
                while (p = fts_read(fts))
                        switch(p->fts_info) {
-                       case FTS_DNR:
-                               (void)fprintf(stderr,
-                                   "chmod: %s: unable to read.\n",
-                                   p->fts_path);
-                               break;
-                       case FTS_DNX:
-                               (void)fprintf(stderr,
-                                   "chmod: %s: unable to search.\n",
-                                   p->fts_path);
-                               break;
                        case FTS_D:
                        case FTS_D:
-                       case FTS_DC:
                                break;
                                break;
+                       case FTS_DNR:
                        case FTS_ERR:
                        case FTS_ERR:
+                       case FTS_NS:
                                (void)fprintf(stderr, "chmod: %s: %s.\n",
                                    p->fts_path, strerror(errno));
                                exit(1);
                                (void)fprintf(stderr, "chmod: %s: %s.\n",
                                    p->fts_path, strerror(errno));
                                exit(1);
-                       case FTS_NS:
-                               (void)fprintf(stderr,
-                                   "chmod: %s: unable to stat.\n",
-                                   p->fts_path);
-                               break;
                        default:
                                if (chmod(p->fts_accpath, oct ? omode :
                                    getmode(set, p->fts_statb.st_mode)) &&
                        default:
                                if (chmod(p->fts_accpath, oct ? omode :
                                    getmode(set, p->fts_statb.st_mode)) &&