Navigation Menu

Skip to content

Commit

Permalink
See errno for error from unlink()
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 15, 2015
1 parent 6b4d883 commit 120ee87
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/io.c
Expand Up @@ -719,15 +719,17 @@ grn_io_remove(grn_ctx *ctx, const char *path)
SERR("stat");
return ctx->rc;
} else if (unlink(path)) {
SERR(path);
ERRNO_ERR(path);
return ctx->rc;
} else {
int fno;
char buffer[PATH_MAX];
for (fno = 1; ; fno++) {
gen_pathname(path, buffer, fno);
if (!stat(buffer, &s)) {
if (unlink(buffer)) { SERR(buffer); }
if (unlink(buffer)) {
ERRNO_ERR(buffer);
}
} else {
break;
}
Expand Down

0 comments on commit 120ee87

Please sign in to comment.