diff options
author | Dmitry V. Levin <ldv@strace.io> | 2024-10-15 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2024-10-15 08:00:00 +0000 |
commit | 29c390c7e5c7ee12a1beebd7458aed2fcba53f91 (patch) | |
tree | 8c9490a470d75a0e96d92a82d3f4d77922bfc450 /modules | |
parent | 83aa08a30f39c10e4cecae43686eb86a1e045496 (diff) | |
download | pam-29c390c7e5c7ee12a1beebd7458aed2fcba53f91.tar.gz pam-29c390c7e5c7ee12a1beebd7458aed2fcba53f91.tar.bz2 pam-29c390c7e5c7ee12a1beebd7458aed2fcba53f91.zip |
build: check gdbm_close return type
gdbm_close() used to return void, later it was changed to return int.
We cannot assume either way and have to check whether gdbm_close()
returns int.
Fixes: 45c2c496dcf8 ("pam_userdb: enable GDBM support")
Diffstat (limited to 'modules')
-rw-r--r-- | modules/pam_userdb/pam_userdb.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/pam_userdb/pam_userdb.c b/modules/pam_userdb/pam_userdb.c index e5942c8a..71012e57 100644 --- a/modules/pam_userdb/pam_userdb.c +++ b/modules/pam_userdb/pam_userdb.c @@ -185,7 +185,12 @@ static int db_close(void *dbm) { #ifdef HAVE_GDBM_H +# ifdef GDBM_CLOSE_RETURNS_INT return gdbm_close(dbm); +# else + gdbm_close(dbm); + return 0; +# endif #else dbm_close(dbm); return 0; |