]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fd-util: Fix error handling in safe_fclose
authorPaweł Szewczyk <p.szewczyk@samsung.com>
Fri, 30 Nov 2018 11:35:23 +0000 (12:35 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 6 Dec 2018 15:15:39 +0000 (16:15 +0100)
Function fclose_nointr returns negative value on error.

src/basic/fd-util.c

index 2fae4da15bcde170de90f97a69cf39455dcbf172..c06f2fac7e80dc8f44996d711a7bae5537ffc9c5 100644 (file)
@@ -114,7 +114,7 @@ FILE* safe_fclose(FILE *f) {
         if (f) {
                 PROTECT_ERRNO;
 
-                assert_se(fclose_nointr(f) != EBADF);
+                assert_se(fclose_nointr(f) != -EBADF);
         }
 
         return NULL;