]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Disable SyncOnClose on Fifo device using /dev/null
authorEric Bollengier <eric@baculasystems.com>
Thu, 15 Feb 2024 10:29:50 +0000 (11:29 +0100)
committerEric Bollengier <eric@baculasystems.com>
Fri, 16 Feb 2024 17:17:28 +0000 (18:17 +0100)
bacula/src/stored/fifo_dev.c

index ec9c32f0f88bac999e2483627600d0f10518c6cd..a516bfa8200f754890bde761945a112e0023d070 100644 (file)
@@ -52,7 +52,12 @@ const char *fifo_dev::print_type()
 
 int fifo_dev::device_specific_init(JCR *jcr, DEVRES *device)
 {
-   capabilities |= CAP_STREAM;
+   set_cap(CAP_STREAM);
+
+   /* Apparently it is not possible to sync the file descriptor on /dev/null */
+   if (strcmp(device->device_name, "/dev/null") == 0) {
+      clear_cap(CAP_SYNCONCLOSE);
+   }
    return 0;
 }