httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dr...@hyperreal.org
Subject cvs commit: apache-2.0/src/lib/apr/threadproc/beos proc.c
Date Wed, 15 Dec 1999 12:35:17 GMT
dreid       99/12/15 04:35:16

  Modified:    src/lib/apr/threadproc/beos proc.c
  Log:
  Update the proc routines for BeOS.  CGI is still hosed though :-(
  
  Revision  Changes    Path
  1.13      +50 -16    apache-2.0/src/lib/apr/threadproc/beos/proc.c
  
  Index: proc.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/beos/proc.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- proc.c	1999/11/05 21:26:29	1.12
  +++ proc.c	1999/12/15 12:35:15	1.13
  @@ -93,26 +93,53 @@
   ap_status_t ap_setprocattr_io(struct procattr_t *attr, ap_int32_t in, 
                                    ap_int32_t out, ap_int32_t err)
   {
  -    ap_status_t stat;
  -    if (in) {
  -        if ((stat = ap_create_pipe(&attr->child_in, &attr->parent_in,
  -                                    attr->cntxt)) != APR_SUCCESS) {
  -            return stat;
  +    ap_status_t status;
  +    if (in != 0) {
  +        if ((status = ap_create_pipe(&attr->child_in, &attr->parent_in, 
  +                                   attr->cntxt)) != APR_SUCCESS) {
  +            return status;
           }
  +        switch (in) {
  +        case APR_FULL_BLOCK:
  +            ap_block_pipe(attr->child_in);
  +            ap_block_pipe(attr->parent_in);
  +        case APR_PARENT_BLOCK:
  +            ap_block_pipe(attr->parent_in);
  +        case APR_CHILD_BLOCK:
  +            ap_block_pipe(attr->child_in);
  +        }
       } 
       if (out) {
  -        if ((stat = ap_create_pipe(&attr->parent_out, &attr->child_out,
  -                                     attr->cntxt)) != APR_SUCCESS) {
  -            return stat;
  +        if ((status = ap_create_pipe(&attr->parent_out, &attr->child_out,

  +                                   attr->cntxt)) != APR_SUCCESS) {
  +            return status;
  +        }
  +        switch (out) {
  +        case APR_FULL_BLOCK:
  +            ap_block_pipe(attr->child_out);
  +            ap_block_pipe(attr->parent_out);
  +        case APR_PARENT_BLOCK:
  +            ap_block_pipe(attr->parent_out);
  +        case APR_CHILD_BLOCK:
  +            ap_block_pipe(attr->child_out);
           }
       } 
       if (err) {
  -        if ((stat = ap_create_pipe(&attr->parent_err, &attr->child_err,
  -                                      attr->cntxt)) != APR_SUCCESS) {
  -            return stat;
  +        if ((status = ap_create_pipe(&attr->parent_err, &attr->child_err,

  +                                   attr->cntxt)) != APR_SUCCESS) {
  +            return status;
  +        }
  +        switch (err) {
  +        case APR_FULL_BLOCK:
  +            ap_block_pipe(attr->child_err);
  +            ap_block_pipe(attr->parent_err);
  +        case APR_PARENT_BLOCK:
  +            ap_block_pipe(attr->parent_err);
  +        case APR_CHILD_BLOCK:
  +            ap_block_pipe(attr->child_err);
           }
       } 
  -	return APR_SUCCESS;
  +    return APR_SUCCESS;
   }
   
   ap_status_t ap_setprocattr_dir(struct procattr_t *attr, 
  @@ -224,10 +251,17 @@
           return errno;
       }
       resume_thread(newproc);
  -    ap_close (attr->child_in);
  -    ap_close (attr->child_out);
  -    ap_close (attr->child_err);
  -    
  +
  +    if (attr->child_in) {
  +        ap_close(attr->child_in);
  +    }
  +    if (attr->child_out) {
  +        ap_close(attr->child_out);
  +    }
  +    if (attr->child_err) {
  +        ap_close(attr->child_err);
  +    }
  +
       send_data(newproc, 0, (void*)sp, sizeof(struct send_pipe));
       (*new)->tid = newproc;
   
  
  
  

Mime
View raw message