httpd/logger.c patch

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

httpd/logger.c patch

Peter J. Philipp-3
Hi,

While auditing something in and around /usr/src/usr.sbin/httpd/logger.c
(didn't find what I was looking for), I noticed that logger_log() was
returning with an int but the return value was not processed at all.  Here
is a small patch that makes the return value void.  I tested this patch
with compilation and running it.

Regards,
-peter


Index: logger.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/logger.c,v
retrieving revision 1.21
diff -u -p -u -r1.21 logger.c
--- logger.c 7 Feb 2018 03:28:05 -0000 1.21
+++ logger.c 11 Mar 2018 21:38:38 -0000
@@ -41,7 +41,7 @@ int logger_open_fd(struct imsg *);
 int logger_open(struct server *, struct server_config *, void *);
 void logger_init(struct privsep *, struct privsep_proc *p, void *);
 int logger_start(void);
-int logger_log(struct imsg *);
+void logger_log(struct imsg *);
 
 static uint32_t last_log_id = 0;
 
@@ -236,7 +236,7 @@ logger_start(void)
  return (0);
 }
 
-int
+void
 logger_log(struct imsg *imsg)
 {
  char *logline;
@@ -257,7 +257,7 @@ logger_log(struct imsg *imsg)
 
  if (log == NULL || log->log_fd == -1) {
  log_warnx("log file %s not opened", log ? log->log_name : "");
- return (0);
+ return;
  }
 
  /* XXX get_string() would sanitize the string, but add a malloc */
@@ -268,10 +268,10 @@ logger_log(struct imsg *imsg)
 
  if (dprintf(log->log_fd, "%s\n", logline) == -1) {
  if (logger_start() == -1)
- return (-1);
+ return;
  }
 
- return (0);
+ return;
 }
 
 int