| 368 | Return true if successful. */ |
| 369 | |
| 370 | static bool |
| 371 | process_files (char **files, int bit_flags) |
| 372 | { |
| 373 | bool ok = true; |
| 374 | |
| 375 | FTS *fts = xfts_open (files, bit_flags, NULL); |
| 376 | |
| 377 | while (true) |
| 378 | { |
| 379 | FTSENT *ent; |
| 380 | |
| 381 | ent = fts_read (fts); |
| 382 | if (ent == NULL) |
| 383 | { |
| 384 | if (errno != 0) |
| 385 | { |
| 386 | /* FIXME: try to give a better message */ |
| 387 | if (! force_silent) |
| 388 | error (0, errno, _("fts_read failed")); |
| 389 | ok = false; |
| 390 | } |
| 391 | break; |
| 392 | } |
| 393 | |
| 394 | ok &= process_file (fts, ent); |
| 395 | } |
| 396 | |
| 397 | if (fts_close (fts) != 0) |
| 398 | { |
| 399 | error (0, errno, _("fts_close failed")); |
| 400 | ok = false; |
| 401 | } |
| 402 | |
| 403 | return ok; |
| 404 | } |
| 405 | |
| 406 | void |
| 407 | usage (int status) |
no test coverage detected