Skip to content

Commit

Permalink
lib: Fix returning error from unlink_directory()
Browse files Browse the repository at this point in the history
On non-ENOENT errors it was returning 1 instead of -1.
  • Loading branch information
sirainen authored and villesavolainen committed May 28, 2018
1 parent 2d207d2 commit 4f4c87b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/unlink-directory.c
Expand Up @@ -266,7 +266,7 @@ int unlink_directory(const char *dir, enum unlink_directory_flags flags,

if (ret < 0) {
errno = old_errno;
return errno == ENOENT ? 0 : 1;
return errno == ENOENT ? 0 : -1;
}

if ((flags & UNLINK_DIRECTORY_FLAG_RMDIR) != 0) {
Expand Down

0 comments on commit 4f4c87b

Please sign in to comment.