Browse Source

Slightly better pidfile work.

Brian Aker 13 years ago
parent
commit
f63f1595d7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      util/pidfile.cc

+ 1 - 1
util/pidfile.cc

@@ -119,7 +119,7 @@ bool Pidfile::create()
   }
 
   int file;
-  if ((file = open(_filename.c_str(), O_CREAT|O_WRONLY|O_TRUNC, S_IRWXU|S_IRGRP|S_IROTH)) < 0)
+  if ((file = open(_filename.c_str(), O_CREAT|O_WRONLY|O_TRUNC|O_CLOEXEC, S_IRWXU|S_IRGRP|S_IROTH)) < 0)
   {
     std::stringstream error_stream;
     error_stream << "Could not open pid file for writing: " << _filename << "(" << strerror(errno) << ")";