| 110 | } |
| 111 | |
| 112 | int |
| 113 | Util::safeMkdir(const char *pathname, mode_t mode) |
| 114 | { |
| 115 | // If it exists and we can give it the right permissions, do it. |
| 116 | chmod(pathname, 0700); |
| 117 | if (isdir0700(pathname)) { |
| 118 | return 0; |
| 119 | } |
| 120 | |
| 121 | // else start over |
| 122 | unlink(pathname); |
| 123 | rmdir(pathname); // Maybe it was an empty directory |
| 124 | mkdir(pathname, 0700); |
| 125 | return isdir0700(pathname); |
| 126 | } |
| 127 | |
| 128 | int |
| 129 | Util::safeSystem(const char *command) |
nothing calls this directly
no test coverage detected