| 1187 | const testing::TestInfo&) |
| 1188 | { |
| 1189 | foreach (const string& directory, directories) { |
| 1190 | #ifdef __linux__ |
| 1191 | // Try to remove any mounts under 'directory'. |
| 1192 | if (::geteuid() == 0) { |
| 1193 | Try<Nothing> unmount = fs::unmountAll(directory, MNT_DETACH); |
| 1194 | if (unmount.isError()) { |
| 1195 | LOG(ERROR) << "Failed to umount for directory '" << directory |
| 1196 | << "': " << unmount.error(); |
| 1197 | } |
| 1198 | } |
| 1199 | #endif |
| 1200 | |
| 1201 | Try<Nothing> rmdir = os::rmdir(directory); |
| 1202 | if (rmdir.isError()) { |
| 1203 | LOG(ERROR) << "Failed to remove '" << directory |
| 1204 | << "': " << rmdir.error(); |
| 1205 | } |
| 1206 | } |
| 1207 | |
| 1208 | directories.clear(); |
| 1209 | } |
nothing calls this directly
no test coverage detected