#include <unistd.h>
#include <ctype.h>
#include <stdarg.h>
+#include <fcntl.h>
#include "bspwm.h"
#include "desktop.h"
#include "settings.h"
if (sb == subscribe_tail) {
subscribe_tail = a;
}
- if (!restart) {
+ if (restart) {
+ int cli_fd = fileno(sb->stream);
+ fcntl(cli_fd, F_SETFD, ~FD_CLOEXEC & fcntl(cli_fd, F_GETFD));
+ } else {
fclose(sb->stream);
unlink(sb->fifo_path);
}
sb->prev = subscribe_tail;
subscribe_tail = sb;
}
+ int cli_fd = fileno(sb->stream);
+ fcntl(cli_fd, F_SETFD, FD_CLOEXEC | fcntl(cli_fd, F_GETFD));
if (sb->field & SBSC_MASK_REPORT) {
print_report(sb->stream);
if (sb->count-- == 1) {