#include <sys/wait.h>
#include <sys/socket.h>
#include <sys/un.h>
+#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
#include <stdbool.h>
}
}
+ fcntl(sock_fd, F_SETFD, FD_CLOEXEC | fcntl(sock_fd, F_GETFD));
+
signal(SIGINT, sig_handler);
signal(SIGHUP, sig_handler);
signal(SIGTERM, sig_handler);
xcb_disconnect(dpy);
if (restart) {
+ fcntl(sock_fd, F_SETFD, ~FD_CLOEXEC & fcntl(sock_fd, F_GETFD));
+
int rargc;
for (rargc = 0; rargc < argc; rargc++) {
if (streq("-s", argv[rargc])) {
#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) {