| 467 | } |
| 468 | |
| 469 | static void verify_directory(const char *directory) |
| 470 | { |
| 471 | struct stat buf; |
| 472 | |
| 473 | if (stat(directory, &buf) < 0) |
| 474 | { |
| 475 | fprintf(stderr, "ERROR: stat of %s failed: %s\n", |
| 476 | directory, strerror(errno)); |
| 477 | exit(EXIT_FAILURE); |
| 478 | } |
| 479 | |
| 480 | if (!S_ISDIR(buf.st_mode)) |
| 481 | { |
| 482 | fprintf(stderr, "ERROR: %s exists but is not a directory\n", |
| 483 | directory); |
| 484 | exit(EXIT_FAILURE); |
| 485 | } |
| 486 | } |
| 487 | |
| 488 | static bool verify_optiondir(const char *directory) |
| 489 | { |
no test coverage detected