You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Behlendorf <br...@organic.com> on 1996/10/01 05:28:11 UTC
Re: patch for error log overwrite problem
I got the following comment from Mark Brown:
The patch should have no ill effect on correct systems.
Since there was no negative comment towards this patch, and there was also a
report that this is needed on Linux, it has been committed.
Brian
On Fri, 27 Sep 1996, Brian Behlendorf wrote:
> Are there any other comments on this patch? Any vetos? Should this be wrapped
> in a -DBROKEN_FILE_APPEND or something, which gets set in the SUNOS #define's?
>
> Brian
>
> On Tue, 24 Sep 1996, Mark Brown wrote:
> > Here is a patch for the error log overwrite problem I reported
> > earlier. I have tested the patch on SunOS 4.1.4.
> >
> > The patch is relative to 1.1.1; I don't know where to get a candidate
> > 1.2 to try.
> >
> > --mark
> >
> > * * * * *
> >
> > % diff -c alloc.c alloc.c.orig
> > *** alloc.c Mon Sep 23 17:45:34 1996
> > --- alloc.c.orig Mon Sep 23 17:43:16 1996
> > ***************
> > *** 765,784 ****
> >
> > FILE *pfopen(struct pool *a, char *name, char *mode)
> > {
> > ! FILE *fd = NULL;
> >
> > block_alarms();
> > ! if (*mode == 'a') {
> > ! /* Work around faulty implementations of fopen */
> > ! int baseFlag = (*(mode+1) == '+') ? O_RDWR : O_WRONLY;
> > ! int desc = open(name, baseFlag | O_APPEND | O_CREAT,
> > ! S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
> > ! if (desc >= 0) {
> > ! fd = fdopen(desc, mode);
> > ! }
> > ! } else {
> > ! fd = fopen(name, mode);
> > ! }
> > if (fd != NULL) note_cleanups_for_file (a, fd);
> > unblock_alarms();
> > return fd;
> > --- 765,774 ----
> >
> > FILE *pfopen(struct pool *a, char *name, char *mode)
> > {
> > ! FILE *fd;
> >
> > block_alarms();
> > ! fd = fopen(name, mode);
> > if (fd != NULL) note_cleanups_for_file (a, fd);
> > unblock_alarms();
> > return fd;
> >
> > * * * * *
> >
> >
> >
> >
>
> --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
> brian@organic.com www.apache.org hyperreal.com http://www.organic.com/JOBS
>
>
--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com www.apache.org hyperreal.com http://www.organic.com/JOBS