From 579937639a4b651719c17e801729b89799a83700 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Mon, 9 Jan 2012 12:10:23 +0000 Subject: Warn if fd cannot be closed in is_locked() git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1592 ef36b2f9-881f-0410-afb5-c4e39611909c --- nslcd/nslcd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nslcd') diff --git a/nslcd/nslcd.c b/nslcd/nslcd.c index 4c16a91..4f4d7b9 100644 --- a/nslcd/nslcd.c +++ b/nslcd/nslcd.c @@ -472,10 +472,12 @@ static int is_locked(const char* filename) } if (lockf(fd,F_TEST,0)<0) { - close(fd); + if (close(fd)) + log_log(LOG_WARNING,"problem closing fd: %s",strerror(errno)); return -1; } - close(fd); + if (close(fd)) + log_log(LOG_WARNING,"problem closing fd: %s",strerror(errno)); } return 0; } -- cgit v1.2.3