From: Eric Bollengier Date: Thu, 15 Feb 2024 10:29:50 +0000 (+0100) Subject: Disable SyncOnClose on Fifo device using /dev/null X-Git-Tag: Release-15.0.2~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df72fa2b3e4626a58695cec0d875db2e29aee183;p=thirdparty%2Fbacula.git Disable SyncOnClose on Fifo device using /dev/null --- diff --git a/bacula/src/stored/fifo_dev.c b/bacula/src/stored/fifo_dev.c index ec9c32f0f..a516bfa82 100644 --- a/bacula/src/stored/fifo_dev.c +++ b/bacula/src/stored/fifo_dev.c @@ -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; }