diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/pam-module.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pam-module.c b/src/pam-module.c index 7f91584705..e1a1a5001c 100644 --- a/src/pam-module.c +++ b/src/pam-module.c @@ -198,8 +198,12 @@ static int open_file_and_lock(const char *fn) { * as the filesystems in question should be local, and only * locally accessible, and most likely even tmpfs. */ - if (flock(fd, LOCK_EX) < 0) - return -errno; + if (flock(fd, LOCK_EX) < 0) { + int r = -errno; + + close_nointr_nofail(fd); + return r; + } return fd; } |