httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@hyperreal.org
Subject cvs commit: apache-apr/apr/file_io/unix open.c
Date Mon, 22 Feb 1999 15:36:18 GMT
coar        99/02/22 07:36:17

  Modified:    apr/file_io/unix open.c
  Log:
  	Style guide..
  
  Revision  Changes    Path
  1.2       +26 -14    apache-apr/apr/file_io/unix/open.c
  
  Index: open.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/apr/file_io/unix/open.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- open.c	1999/02/22 13:04:10	1.1
  +++ open.c	1999/02/22 15:36:17	1.2
  @@ -1,3 +1,4 @@
  +
   #include "file_io.h"
   
   API_EXPORT(APRFile *) apr_open(char *fname, int flag, mode_t mode)
  @@ -6,45 +7,55 @@
       APR_FILE *dafile;
       struct stat info;
   
  -    if ((flag && APR_READ) && (flag && APR_WRITE))
  +    if ((flag && APR_READ) && (flag && APR_WRITE)) {
           oflags = O_RDWR;
  -    else if (flag && APR_READ)
  +    }
  +    else if (flag && APR_READ) {
           oflags = O_RDONLY;
  -    else if (flag && APR_WRITE)
  +    }
  +    else if (flag && APR_WRITE) {
           oflags = O_WRONLY;
  +    }
       else {
           errno = EACCESS;
   	return NULL;
       }
   
  -    if (flag && APR_BUFFERED)
  -        dafile->buffered = TRUE
  +    if (flag && APR_BUFFERED) {
  +        dafile->buffered = TRUE;
  +    }
       strcpy(dafile->fname, fname);
   
       if (flag && APR_CREATE) {
  -        oflags |= O_CREAT;
  -	if (flag && APR_EXCL)
  +        oflags |= O_CREAT; 
  +	if (flag && APR_EXCL) {
   	    oflags |= O_EXCL;
  +	}
       }
       if ((flag && APR_EXCL) && !(flag && APR_CREATE)) {
           errno = EACCESS;
   	return NULL;
       }   
   
  -    if (flag && APR_APPEND)
  +    if (flag && APR_APPEND) {
           oflags |= O_APPEND;
  -    if (flag && APR_TRUNCATE)
  +    }
  +    if (flag && APR_TRUNCATE) {
           oflags = O_TRUNC;
  -    if (flag && APR_NONBLOCK)
  +    }
  +    if (flag && APR_NONBLOCK) {
           oflags = O_NONBLOCK;
  -    else
  +    }
  +    else {
           oflags = O_SYNC;
  +    }
    
       dafile->filedes = open(fname, oflags, mode);
       
  -    if (dafile->filedes < 0) 
  +    if (dafile->filedes < 0) {
           return NULL;
  -    
  +    }
  +
       if (stat(dafile->filedes, &info) == 0) {
           dafile->protection = info.st_mode;
   	dafile->user = info.st_uid;
  @@ -54,7 +65,8 @@
   	dafile->mtime = info.st_mtime;
   	dafile->ctime = info.st_ctime;
   	return dafile;
  -    } else {
  +    }
  +    else {
           errno = ENOSTAT;
   	return NULL;
       }
  
  
  

Mime
View raw message