Helper: mkdirp */
| 723 | |
| 724 | /* Helper: mkdirp */ |
| 725 | static int test_mkdirp(const char *path) { |
| 726 | char tmp[1024]; |
| 727 | snprintf(tmp, sizeof(tmp), "%s", path); |
| 728 | for (char *p = tmp + 1; *p; p++) { |
| 729 | if (*p == '/') { |
| 730 | *p = '\0'; |
| 731 | cbm_mkdir(tmp); |
| 732 | *p = '/'; |
| 733 | } |
| 734 | } |
| 735 | return cbm_mkdir(tmp) == 0 || errno == EEXIST ? 0 : -1; |
| 736 | } |
| 737 | |
| 738 | /* Helper: recursive remove */ |
| 739 | static void test_rmdir_r(const char *path) { |
no outgoing calls
no test coverage detected