Skip to content

Commit e7fad03

Browse files
committed
fix
1 parent 7da06b2 commit e7fad03

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

unix/watcher_unix.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <cstdio>
1515
#include <cstdlib>
1616
#include <cstring>
17+
#include <memory>
1718
#include <signal.h>
1819
#include <sstream>
1920
#include <string>
@@ -158,6 +159,7 @@ auto main(int argc, char *argv[]) -> int {
158159
pid = fork();
159160

160161
if (pid > 0) {
162+
// Parent process
161163
signal(SIGINT, cleanUp);
162164
signal(SIGABRT, cleanUp);
163165
signal(SIGTERM, cleanUp);
@@ -186,7 +188,7 @@ auto main(int argc, char *argv[]) -> int {
186188
}).detach();
187189

188190
struct rusage usage{};
189-
int status;
191+
int status = 0;
190192

191193
while (wait4(pid, &status, 0, &usage) == -1) {
192194
if (errno == EINTR)

0 commit comments

Comments
 (0)