X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fpam-module.c;h=e1a1a5001cedc9b438a31546906511949716c703;hb=88213476187cafc86bea2276199891873000588d;hp=7f915847052b061dd0de370aad67b615dbf36532;hpb=e9fbc77c8f6a396ce9432e3791710e30de6e570b;p=elogind.git diff --git a/src/pam-module.c b/src/pam-module.c index 7f9158470..e1a1a5001 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; }