From df72fa2b3e4626a58695cec0d875db2e29aee183 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 15 Feb 2024 11:29:50 +0100 Subject: [PATCH] Disable SyncOnClose on Fifo device using /dev/null --- bacula/src/stored/fifo_dev.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } -- 2.47.3