Ticket #1019: lighttpd-1.4.13-pidfile.patch

File lighttpd-1.4.13-pidfile.patch, 0.9 kB (added by chris@…, 19 months ago)
  • src/server.c

    old new  
    12311231                                                srv_socket->fd = -1; 
    12321232 
    12331233                                                /* network_close() will cleanup after us */ 
     1234 
     1235                                                if (srv->srvconf.pid_file->used && 
     1236                                                    srv->srvconf.changeroot->used == 0) { 
     1237                                                        if (0 != unlink(srv->srvconf.pid_file->ptr)) { 
     1238                                                                if (errno != EACCES && errno != EPERM) { 
     1239                                                                        log_error_write(srv, __FILE__, __LINE__, "sbds", 
     1240                                                                                        "unlink failed for:", 
     1241                                                                                        srv->srvconf.pid_file, 
     1242                                                                                        errno, 
     1243                                                                                        strerror(errno)); 
     1244                                                                } 
     1245                                                        } 
     1246                                                } 
    12341247                                        } 
    12351248                                } 
    12361249 
     
    13351348        } 
    13361349 
    13371350        if (srv->srvconf.pid_file->used && 
    1338             srv->srvconf.changeroot->used == 0) { 
     1351            srv->srvconf.changeroot->used == 0 && 
     1352            0 == graceful_shutdown) { 
    13391353                if (0 != unlink(srv->srvconf.pid_file->ptr)) { 
    13401354                        if (errno != EACCES && errno != EPERM) { 
    13411355                                log_error_write(srv, __FILE__, __LINE__, "sbds",