View | Details | Raw Unified | Return to bug 47335
Collapse All | Expand All

(-)mod_cgid.c.old (-7 / +11 lines)
Lines 302-307 Link Here
302
}
302
}
303
#endif
303
#endif
304
304
305
static apr_status_t close_unix_socket(void *thefd)
306
{
307
    int fd = (int)((long)thefd);
308
309
    return close(fd);
310
}
311
305
/* deal with incomplete reads and signals
312
/* deal with incomplete reads and signals
306
 * assume you really have to read buf_size bytes
313
 * assume you really have to read buf_size bytes
307
 */
314
 */
Lines 632-637 Link Here
632
        }
639
        }
633
    }
640
    }
634
641
642
    apr_pool_cleanup_register(pcgi, (void *)((long)sd),
643
                              close_unix_socket, close_unix_socket);
644
635
    unixd_setup_child(); /* if running as root, switch to configured user/group */
645
    unixd_setup_child(); /* if running as root, switch to configured user/group */
636
646
637
    while (!daemon_should_exit) {
647
    while (!daemon_should_exit) {
Lines 741-746 Link Here
741
             */
751
             */
742
            ap_log_error(APLOG_MARK, APLOG_ERR, rc, r->server,
752
            ap_log_error(APLOG_MARK, APLOG_ERR, rc, r->server,
743
                         "couldn't set child process attributes: %s", r->filename);
753
                         "couldn't set child process attributes: %s", r->filename);
754
            close(sd2);
744
        }
755
        }
745
        else {
756
        else {
746
            apr_pool_userdata_set(r, ERRFN_USERDATA_KEY, apr_pool_cleanup_null, ptrans);
757
            apr_pool_userdata_set(r, ERRFN_USERDATA_KEY, apr_pool_cleanup_null, ptrans);
Lines 1113-1125 Link Here
1113
    return ret;
1124
    return ret;
1114
}
1125
}
1115
1126
1116
static apr_status_t close_unix_socket(void *thefd)
1117
{
1118
    int fd = (int)((long)thefd);
1119
1120
    return close(fd);
1121
}
1122
1123
static int connect_to_daemon(int *sdptr, request_rec *r,
1127
static int connect_to_daemon(int *sdptr, request_rec *r,
1124
                             cgid_server_conf *conf)
1128
                             cgid_server_conf *conf)
1125
{
1129
{

Return to bug 47335