diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2006-11-01 12:08:33 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2006-11-01 12:08:33 +0000 |
commit | 3964dee96be1b083da654d9b0d8435e8b6c314ff (patch) | |
tree | 907431c7e5decc0f789ac22a1045eb3d46a1e653 | |
parent | 11fb79a656889b6b2740b39acc48164693d265cd (diff) |
also set file pointer to NULL when closing a stream to properly handle reuse of stream
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@43 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r-- | nss/common.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nss/common.h b/nss/common.h index d7be6a7..dbf0758 100644 --- a/nss/common.h +++ b/nss/common.h @@ -38,19 +38,22 @@ enum nss_status nslcd2nss(int code); #define ERROR_OUT_READERROR(fp) \ fclose(fp); \ + fp=NULL; \ *errnop=ENOENT; \ - return NSS_STATUS_UNAVAIL; \ + return NSS_STATUS_UNAVAIL; #define ERROR_OUT_BUFERROR(fp) \ fclose(fp); \ + fp=NULL; \ *errnop=ERANGE; \ - return NSS_STATUS_TRYAGAIN; \ + return NSS_STATUS_TRYAGAIN; #define ERROR_OUT_WRITEERROR(fp) \ ERROR_OUT_READERROR(fp) #define ERROR_OUT_NOSUCCESS(fp,retv) \ fclose(fp); \ + fp=NULL; \ *errnop=ENOENT; \ return nslcd2nss(retv); |