util/jobutil.cc
/// Create and return a PID file handle for the pidfile named by prog.
/// Return (-1) if we could not create this file, e.g. because
/// it is already locked by a live process.
///
Create and return a PID file handle for the pidfile named by prog.
Return (-1) if we could not create this file, e.g. because
it is already locked by a live process.
Create and return a PID file handle for the pidfile named by prog . Return ( - 1 ) if we could not create this file e . g . because it is already locked by a live process .
int mark_running( const char *prog )
{
    fs::path pidpath;
    pid_t my_pid = getpid();
    get_pid_path(prog,pidpath);
    fs::ofstream  pofs( pidpath );
    if (pofs.fail()) {
        return (-1);
    }
    pofs << my_pid;
    std::cerr << "Marked " << my_pid << " for program " << prog << std::endl;
    return 0;
}
int mark_running ( const char * prog ) { fs :: path pidpath ; pid_t my_pid = getpid ( ) ; get_pid_path ( prog , pidpath ) ; fs :: ofstream pofs ( pidpath ) ; if ( pofs . fail ( ) ) { return ( -1 ) ; } pofs << my_pid ; std :: cerr << " " << my_pid << " " << prog << std :: endl ; return 0 ; }
Create and return a PID file handle for the pidfile named by prog.
Create and return a PID file handle for the pidfile named by prog .