Skip to content

Commit 88168f4

Browse files
committed
create pidfile
1 parent c12ea34 commit 88168f4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,11 @@ int main(int argc, char **argv)
552552

553553
osd_vars.enable_recording = 0;
554554

555+
std::string pidFilePath = "/run/pixelpilot.pid";
556+
std::ofstream pidFile(pidFilePath);
557+
pidFile << getpid();
558+
pidFile.close();
559+
555560
// Load console arguments
556561
__BeginParseConsoleArguments__(printHelp)
557562

@@ -896,5 +901,7 @@ int main(int argc, char **argv)
896901
modeset_cleanup(drm_fd, output_list);
897902
close(drm_fd);
898903

904+
remove(pidFilePath.c_str());
905+
899906
return 0;
900907
}

0 commit comments

Comments
 (0)