Changeset 454 for trunk/server/source3/lib/pidfile.c
- Timestamp:
- Jun 4, 2010, 3:11:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/lib/pidfile.c
r414 r454 68 68 } 69 69 70 #ifndef __OS2__ // if we lock the file, we won't be able to read it later on OS/2 70 71 if (fcntl_lock(fd,SMB_F_SETLK,0,1,F_RDLCK)) { 71 72 /* we could get the lock - it can't be a Samba process */ 72 73 goto noproc; 73 74 } 75 #endif 74 76 75 77 SAFE_FREE(pidFile); … … 95 97 /* Add a suffix to the program name if this is a process with a 96 98 * none default configuration file name. */ 99 100 /* On OS/2, CONFIGFILE will always be different to dyn_CONFIGFILE 101 as dyn_CONFIGFILE dynamically looks up the system ETC directory */ 102 #ifndef __OS2__ 103 97 104 if (strcmp( CONFIGFILE, get_dyn_CONFIGFILE()) == 0) { 98 105 name = SMB_STRDUP(program_name); … … 111 118 } 112 119 } 120 #else 121 name = SMB_STRDUP(program_name); 122 #endif 113 123 114 124 if (asprintf(&pidFile_name, "%s/%s.pid", lp_piddir(), name) == -1) { … … 144 154 exit(1); 145 155 } 156 146 157 /* Leave pid file open & locked for the duration... */ 147 158 SAFE_FREE(name); 159 #ifdef __OS2__ // If we leave the file open & locked on OS/2 - we can't read it, so close the fd 160 close(fd); 161 #endif 148 162 } 149 163
Note:
See TracChangeset
for help on using the changeset viewer.