~mordred/gearmand/cancel-job

« back to all changes in this revision

Viewing changes to util/pidfile.cc

  • Committer: Brian Aker
  • Date: 2012-05-04 03:46:04 UTC
  • Revision ID: brian@tangent.org-20120504034604-5t22ae4v2o45zjkq
Update for libtest, documentation, and fix for root bzr dir.

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
    }
119
119
  }
120
120
 
 
121
  int oflags= O_CREAT|O_WRONLY|O_TRUNC;
 
122
#ifdef HAVE_O_CLOEXEC
 
123
  oflags= oflags | O_CLOEXEC;
 
124
#endif
 
125
 
121
126
  int file;
122
 
  if ((file = open(_filename.c_str(), O_CREAT|O_WRONLY|O_TRUNC, S_IRWXU|S_IRGRP|S_IROTH)) < 0)
 
127
  if ((file = open(_filename.c_str(), oflags, S_IRWXU|S_IRGRP|S_IROTH)) < 0)
123
128
  {
124
129
    std::stringstream error_stream;
125
130
    error_stream << "Could not open pid file for writing: " << _filename << "(" << strerror(errno) << ")";