- if (!(tree = ftsopen(paths, ftsoptions, NULL))) {
- (void)fprintf(stderr, "find: ftsopen: %s.\n", strerror(errno));
- exit(1);
- }
- while (entry = ftsread(tree)) {
- switch(entry->fts_info) {
- case FTS_DNR:
- (void)fprintf(stderr,
- "find: %s: unable to read.\n", entry->fts_path);
- continue;
- case FTS_DNX:
- (void)fprintf(stderr,
- "find: %s: unable to search.\n", entry->fts_path);
- continue;
- case FTS_ERR:
- (void)fprintf(stderr,
- "find: %s: %s.\n", entry->fts_path,
- strerror(errno));
- continue;
+ if ((tree = fts_open(paths, ftsoptions, (int (*)())NULL)) == NULL)
+ err(1, "ftsopen");
+
+ for (rval = 0; (entry = fts_read(tree)) != NULL;) {
+ switch (entry->fts_info) {