Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/lib/pidfile.c

    r454 r745  
    2121
    2222#include "includes.h"
     23#include "system/filesys.h"
    2324
    2425#ifndef O_NONBLOCK
     
    9798        /* Add a suffix to the program name if this is a process with a
    9899         * none default configuration file name. */
    99 
    100100        /* On OS/2, CONFIGFILE will always be different to dyn_CONFIGFILE
    101101           as dyn_CONFIGFILE dynamically looks up the system ETC directory */   
    102102#ifndef __OS2__
    103 
    104103        if (strcmp( CONFIGFILE, get_dyn_CONFIGFILE()) == 0) {
    105104                name = SMB_STRDUP(program_name);
     
    154153                exit(1);
    155154        }
    156 
    157155        /* Leave pid file open & locked for the duration... */
    158156        SAFE_FREE(name);
     157
    159158#ifdef __OS2__ // If we leave the file open & locked on OS/2 - we can't read it, so close the fd
    160159        close(fd);
     160#else
     161        /* set the close on exec so that we don't leak the fd */
     162        fcntl(fd, F_SETFD, FD_CLOEXEC);
    161163#endif
    162164}
Note: See TracChangeset for help on using the changeset viewer.