]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bsod,loop-util: fix fd validity check
authorLennart Poettering <lennart@poettering.net>
Wed, 1 Nov 2023 12:08:26 +0000 (13:08 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 1 Nov 2023 14:21:20 +0000 (15:21 +0100)
src/journal/bsod.c
src/shared/loop-util.c

index 7c2bead389fc15258b85e43629b14200245b06bf..aba21466af16c660b490faee96f47fbf0b22eb25 100644 (file)
@@ -114,7 +114,7 @@ static int acquire_first_emergency_log_message(char **ret) {
 static int find_next_free_vt(int fd, int *ret_free_vt, int *ret_original_vt) {
         struct vt_stat terminal_status;
 
-        assert(fd);
+        assert(fd >= 0);
         assert(ret_free_vt);
         assert(ret_original_vt);
 
index cab8ef3e7a9630f7c402dd1c53f398ce48307d2e..d346d014d2a7dc9ad8af933212ff50b877b60428 100644 (file)
@@ -88,7 +88,7 @@ static int open_lock_fd(int primary_fd, int operation) {
 }
 
 static int loop_configure_verify_direct_io(int fd, const struct loop_config *c) {
-        assert(fd);
+        assert(fd >= 0);
         assert(c);
 
         if (FLAGS_SET(c->info.lo_flags, LO_FLAGS_DIRECT_IO)) {