Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: CVS

cvs commit: apache/src http_log.c

 

 

Apache cvs RSS feed   Index | Next | Previous | View Threaded


mjc at hyperreal

Apr 15, 1996, 4:34 AM

Post #1 of 1 (56 views)
Permalink
cvs commit: apache/src http_log.c

mjc 96/04/15 04:34:53

Modified: src http_log.c
Log:
Submitted by: James H. Cloos Jr. <cloos [at] jhcloos>

Allow ErrorLogs to be pipes.

Revision Changes Path
1.4 +30 -4 apache/src/http_log.c

Index: http_log.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_log.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C3 -r1.3 -r1.4
*** http_log.c 1996/03/01 02:39:49 1.3
--- http_log.c 1996/04/15 11:34:52 1.4
***************
*** 67,81 ****

#include <stdarg.h>

void open_error_log(server_rec *s, pool *p)
{
char *fname;

fname = server_root_relative (p, s->error_fname);
! if(!(s->error_log = pfopen(p, fname, "a"))) {
! fprintf(stderr,"httpd: could not open error log file %s.\n", fname);
! perror("fopen");
! exit(1);
}
}

--- 67,107 ----

#include <stdarg.h>

+ void error_log_child (void *cmd)
+ {
+ /* Child process code for 'ErrorLog "|..."';
+ * may want a common framework for this, since I expect it will
+ * be common for other foo-loggers to want this sort of thing...
+ */
+
+ cleanup_for_exec();
+ signal (SIGHUP, SIG_IGN);
+ execl (SHELL_PATH, SHELL_PATH, "-c", (char *)cmd, NULL);
+ exit (1);
+ }
+
void open_error_log(server_rec *s, pool *p)
{
char *fname;

fname = server_root_relative (p, s->error_fname);
!
! if (*fname == '|') {
! FILE *dummy;
!
! spawn_child(p, error_log_child, (void *)(fname+1),
! kill_after_timeout, &dummy, NULL);
!
! if (dummy == NULL) {
! fprintf (stderr, "Couldn't fork child for ErrorLog process\n");
! exit (1);
! }
! } else {
! if(!(s->error_log = pfopen(p, fname, "a"))) {
! fprintf(stderr,"httpd: could not open error log file %s.\n", fname);
! perror("fopen");
! exit(1);
! }
}
}

Apache cvs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.