diff options
author | Matt Whitlock <whitslack@users.noreply.github.com> | 2016-04-21 17:18:12 -0400 |
---|---|---|
committer | Matt Whitlock <whitslack@users.noreply.github.com> | 2016-04-21 17:18:12 -0400 |
commit | 63cbfc0400f8fb7a178223645e86a26855434699 (patch) | |
tree | 505868b71af84414520c5598040c8a080b618d6b /tools | |
parent | 863a886db7df7891eca6a1dc0aaea29753481ba3 (diff) | |
download | ConsoleKit2-63cbfc0400f8fb7a178223645e86a26855434699.tar.gz |
ck-remove-directory: return exit code 0 on success
remove_dest_dir() returns the return value of nftw(), which is specified to return 0 on success. The main function was previously returning (ret != TRUE), which would be true in the successful case, as (0 != !0), but true becomes 1 when converted to an int, and a 1 exit code from a process conventionally indicates failure. This commit corrects main's return statement so that a successful run of remove_dest_dir() causes the process to return exit code 0.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ck-remove-directory.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/ck-remove-directory.c b/tools/ck-remove-directory.c index b1a5722..ee48f96 100644 --- a/tools/ck-remove-directory.c +++ b/tools/ck-remove-directory.c @@ -153,7 +153,5 @@ main (int argc, become_user (user_id, dest); - ret = remove_dest_dir (dest); - - return ret != TRUE; + return remove_dest_dir (dest) == 0 ? 0 : 1; } |