httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject pfopen errno patch
Date Fri, 03 Jan 1997 01:14:52 GMT
It's kinda hard to give meaningful errors on a pfopen call without this
patch.  Not that this is the only such change that could be made... but
anyhow :)

Dean

*** apache_1.2b4/src/alloc.c	Sat Dec 14 12:28:45 1996
--- apache_new/src/alloc.c	Thu Jan  2 14:56:37 1997
***************
*** 62,67 ****
--- 62,68 ----
  #include "alloc.h"
  
  #include <stdarg.h>
+ #include <errno.h>
  
  /*****************************************************************
   *
***************
*** 777,782 ****
--- 778,784 ----
  {
    FILE *fd = NULL;
    int baseFlag, desc;
+   int save_errno;
  
    block_alarms();
  
***************
*** 785,790 ****
--- 787,793 ----
      baseFlag = (*(mode+1) == '+') ? O_RDWR : O_WRONLY;
      desc = open(name, baseFlag | O_APPEND | O_CREAT,
  		S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
+     save_errno = errno;
      if (desc >= 0) {
        fd = fdopen(desc, mode);
      }
***************
*** 794,799 ****
--- 797,803 ----
  
    if (fd != NULL) note_cleanups_for_file (a, fd);
    unblock_alarms();
+   errno = save_errno;
    return fd;
  }
  



Mime
View raw message