Skip to content

Commit dcd4f8e

Browse files
committed
create pidfile
1 parent 94e3606 commit dcd4f8e

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
@@ -549,6 +549,11 @@ int main(int argc, char **argv)
549549

550550
osd_vars.enable_recording = 0;
551551

552+
std::string pidFilePath = "/run/pixelpilot.pid";
553+
std::ofstream pidFile(pidFilePath);
554+
pidFile << getpid();
555+
pidFile.close();
556+
552557
// Load console arguments
553558
__BeginParseConsoleArguments__(printHelp)
554559

@@ -887,5 +892,7 @@ int main(int argc, char **argv)
887892
modeset_cleanup(drm_fd, output_list);
888893
close(drm_fd);
889894

895+
remove(pidFilePath.c_str());
896+
890897
return 0;
891898
}

0 commit comments

Comments
 (0)