Skip to content
Snippets Groups Projects
Commit 5c040405 authored by Andreas Dilger's avatar Andreas Dilger
Browse files

Fix munlink messages to not make it appear like there was an unlink failure.

b=2167
parent 46d73581
No related branches found
No related tags found
No related merge requests found
......@@ -13,16 +13,23 @@ int main(int argc, char ** argv)
{
int rc, i;
if (argc < 2) {
printf("Usage %s filename\n", argv[0]);
if (argc < 2) {
printf("Usage %s filename {filename ...}\n", argv[0]);
return 1;
}
for (i = 1; i < argc; i++) {
rc = unlink(argv[i]);
if (rc)
printf("unlink(%s) error: %s\n", argv[i],
strerror(errno));
rc = unlink(argv[i]);
if (rc) {
printf("unlink(%s): %s ", argv[i], strerror(errno));
rc = access(argv[i], F_OK);
if (rc && errno == ENOENT)
printf("(unlinked anyways)\n");
else if (rc == 0)
printf("(still exists)\n");
else
printf("(%s looking up)\n", strerror(errno));
}
}
return rc;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment