Changeset 1656

Show
Ignore:
Timestamp:
02/17/2007 06:17:00 PM (1 year ago)
Author:
glen
Message:

- prevent wrong pidfile unlinking on graceful restart (patch by Chris Webb)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/lighttpd-1.4.x/src/server.c

    r1519 r1656  
    12331233 
    12341234                                                /* network_close() will cleanup after us */ 
     1235 
     1236                                                if (srv->srvconf.pid_file->used && 
     1237                                                    srv->srvconf.changeroot->used == 0) { 
     1238                                                        if (0 != unlink(srv->srvconf.pid_file->ptr)) { 
     1239                                                                if (errno != EACCES && errno != EPERM) { 
     1240                                                                        log_error_write(srv, __FILE__, __LINE__, "sbds", 
     1241                                                                                        "unlink failed for:", 
     1242                                                                                        srv->srvconf.pid_file, 
     1243                                                                                        errno, 
     1244                                                                                        strerror(errno)); 
     1245                                                                } 
     1246                                                        } 
     1247                                                } 
    12351248                                        } 
    12361249                                } 
     
    13371350 
    13381351        if (srv->srvconf.pid_file->used && 
    1339             srv->srvconf.changeroot->used == 0) { 
     1352            srv->srvconf.changeroot->used == 0 && 
     1353            0 == graceful_shutdown) { 
    13401354                if (0 != unlink(srv->srvconf.pid_file->ptr)) { 
    13411355                        if (errno != EACCES && errno != EPERM) {