manoj       99/10/31 19:20:53

  Modified:    src/lib/apr/file_io/unix open.c
  Log:
  Some cleanup
  
  Revision  Changes    Path
  1.17      +10 -6     apache-2.0/src/lib/apr/file_io/unix/open.c
  
  Index: open.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/open.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -d -u -r1.16 -r1.17
  --- open.c    1999/10/14 14:36:30     1.16
  +++ open.c    1999/11/01 03:20:52     1.17
  @@ -75,6 +75,7 @@
   
       if (rv == 0) {
           file->filedes = -1;
  +        file->filehand = NULL;
           return APR_SUCCESS;
       }
       else {
  @@ -116,26 +117,29 @@
       (*new)->filedes = -1;
   
       if ((flag & APR_READ) && (flag & APR_WRITE)) {
  -        buf_oflags = strdup("r+");
  +        buf_oflags = ap_pstrdup(cont, "r+");
           oflags = O_RDWR;
       }
       else if (flag & APR_READ) {
  -        buf_oflags = strdup("r");
  +        buf_oflags = ap_pstrdup(cont, "r");
           oflags = O_RDONLY;
       }
       else if (flag & APR_WRITE) {
  -        buf_oflags = strdup("w");
  +        buf_oflags = ap_pstrdup(cont, "r");
           oflags = O_WRONLY;
       }
       else {
  -       (*new)->filedes = -1;
  +        (*new)->filedes = -1;
           return APR_EACCES; 
       }
   
       if (flag & APR_BUFFERED) {
  -       (*new)->buffered = TRUE;
  +        (*new)->buffered = TRUE;
       }
  -   (*new)->fname = strdup(fname);
  +    else {
  +        (*new)->buffered = FALSE;
  +    }
  +    (*new)->fname = ap_pstrdup(cont, fname);
   
       if (flag & APR_CREATE) {
           oflags |= O_CREAT; 
  
  
  

Reply via email to