summaryrefslogtreecommitdiff
path: root/src/inspircd_io.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inspircd_io.cpp')
-rw-r--r--src/inspircd_io.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp
index 7a2ad99f8..19f853ddb 100644
--- a/src/inspircd_io.cpp
+++ b/src/inspircd_io.cpp
@@ -67,6 +67,20 @@ void Start (void)
printf("\033[1;37mName concept:\033[0;37m Lord_Zathras\n\n");
}
+void WritePID(std::string filename)
+{
+ ofstream outfile(filename.c_str());
+ if (outfile.is_open())
+ {
+ outfile << getpid();
+ outfile.close();
+ }
+ else
+ {
+ printf("Failed to write PID-file '%s', exiting.\n",filename.c_str());
+ Exit(0);
+ }
+}
void DeadPipe(int status)
{