From: Michael Orlitzky Date: Thu, 1 Mar 2018 21:12:41 +0000 (-0500) Subject: src/libadacl.c: don't try to close file descriptor zero. X-Git-Tag: v0.2.0~17 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=c5fdaba07b5f965edca0a57d9c3cd8f8bbabc155;p=apply-default-acl.git src/libadacl.c: don't try to close file descriptor zero. --- diff --git a/src/libadacl.c b/src/libadacl.c index f00a804..d924322 100644 --- a/src/libadacl.c +++ b/src/libadacl.c @@ -968,11 +968,11 @@ int apply_default_acl_ex(const char* path, if (new_acl_unmasked != (acl_t)NULL) { acl_free(new_acl_unmasked); } - if (fd >= 0 && close(fd) == CLOSE_ERROR) { + if (fd > 0 && close(fd) == CLOSE_ERROR) { perror("apply_default_acl_ex (close fd)"); result = ACL_ERROR; } - if (parent_fd >= 0 && close(parent_fd) == CLOSE_ERROR) { + if (parent_fd > 0 && close(parent_fd) == CLOSE_ERROR) { perror("apply_default_acl_ex (close parent_fd)"); result = ACL_ERROR; }