]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: improve act file close
authorKarel Zak <kzak@redhat.com>
Wed, 24 Jan 2024 08:54:19 +0000 (09:54 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 24 Jan 2024 08:54:19 +0000 (09:54 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/tab_update.c

index e22850a3cccfd689bc8b8425ffbc1621b898912c..f0c99b82da5b63993152eedaab69b0e39dfbb730 100644 (file)
@@ -1086,7 +1086,8 @@ fail:
        DBG(UPDATE, ul_debugobj(upd, "act file failed [rc=%d]", rc));
        mnt_unlock_file(upd->lock);
        unlink(upd->act_filename);
-       close(upd->act_fd);
+       if (upd->act_fd >= 0)
+               close(upd->act_fd);
        upd->act_fd = -1;
        return rc;
 }