summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/log.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/log.c b/sway/log.c
index 9b9a9dc0..44f6e366 100644
--- a/sway/log.c
+++ b/sway/log.c
@@ -19,10 +19,10 @@ static const char *verbosity_colors[] = {
19void init_log(int verbosity) { 19void init_log(int verbosity) {
20 v = verbosity; 20 v = verbosity;
21 /* set FD_CLOEXEC flag to prevent programs called with exec to write into logs */ 21 /* set FD_CLOEXEC flag to prevent programs called with exec to write into logs */
22 int i, flag; 22 int i;
23 int fd[] = { STDOUT_FILENO, STDIN_FILENO, STDERR_FILENO }; 23 int fd[] = { STDOUT_FILENO, STDIN_FILENO, STDERR_FILENO };
24 for (i = 0; i < 3; ++i) { 24 for (i = 0; i < 3; ++i) {
25 flag = fcntl(fd[i], F_GETFD); 25 int flag = fcntl(fd[i], F_GETFD);
26 if (flag != -1) { 26 if (flag != -1) {
27 fcntl(fd[i], F_SETFD, flag | FD_CLOEXEC); 27 fcntl(fd[i], F_SETFD, flag | FD_CLOEXEC);
28 } 28 }