[1955] in Athena Bugs

home help back first fref pref prev next nref lref last post

Version 6.1C: syslogd.c

daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Wed Mar 22 12:08:11 1989

Date: Wed, 22 Mar 89 12:07:52 EST
From: Jonathan I. Kamens <jik@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU

What's wrong:

There are several calls to the function fprintlog which only pass in
three function arguments.  Fprintlog expects five function arguments,
and the last two are NOT optional.

A patch to fix the problem is below.

jik

		      *************************

*** /minos/source/4.3/athena.lib/zephyr/clients/syslogd/syslogd.c	Wed Mar 22 12:04:25 1989
--- syslogd.c	Wed Mar 22 11:52:34 1989
***************
*** 132,137 ****
--- 132,138 ----
  	char	f_lasttime[16];			/* time of last occurrence */
  	char	f_prevhost[MAXHOSTNAMELEN+1];	/* host from which recd. */
  	int	f_prevpri;			/* pri of f_prevline */
+ 	int	f_prevfac;			/* fac of f_prevline */
  	int	f_prevlen;			/* length of f_prevline */
  	int	f_prevcount;			/* repetition cnt of prevline */
  	int	f_repeatcount;			/* number of "repeated" msgs */
***************
*** 653,658 ****
--- 654,660 ----
  			if (msglen < MAXSVLINE) {
  				f->f_prevlen = msglen;
  				f->f_prevpri = pri;
+ 				f->f_prevfac = fac;
  				(void) strcpy(f->f_prevline, msg);
  				fprintlog(f, flags, (char *)NULL, fac, prilev);
  			} else {
***************
*** 978,984 ****
  			dprintf("flush %s: repeated %d times, %d sec.\n",
  			    TypeNames[f->f_type], f->f_prevcount,
  			    repeatinterval[f->f_repeatcount]);
! 			fprintlog(f, 0, (char *)NULL);
  			BACKOFF(f);
  		}
  	}
--- 980,987 ----
  			dprintf("flush %s: repeated %d times, %d sec.\n",
  			    TypeNames[f->f_type], f->f_prevcount,
  			    repeatinterval[f->f_repeatcount]);
! 			fprintlog(f, 0, (char *)NULL, f->f_prevfac,
! 				  f->f_prevpri);
  			BACKOFF(f);
  		}
  	}
***************
*** 1015,1021 ****
  	for (f = Files; f != NULL; f = f->f_next) {
  		/* flush any pending output */
  		if (f->f_prevcount)
! 			fprintlog(f, 0, (char *)NULL);
  	}
  	if (sig) {
  		dprintf("syslogd: exiting on signal %d\n", sig);
--- 1018,1025 ----
  	for (f = Files; f != NULL; f = f->f_next) {
  		/* flush any pending output */
  		if (f->f_prevcount)
! 			fprintlog(f, 0, (char *)NULL, f->f_prevfac,
! 				  f->f_prevpri);
  	}
  	if (sig) {
  		dprintf("syslogd: exiting on signal %d\n", sig);
***************
*** 1048,1054 ****
  	for (f = Files; f != NULL; f = next) {
  		/* flush any pending output */
  		if (f->f_prevcount)
! 			fprintlog(f, 0, (char *)NULL);
  
  		switch (f->f_type) {
  		  case F_FILE:
--- 1052,1059 ----
  	for (f = Files; f != NULL; f = next) {
  		/* flush any pending output */
  		if (f->f_prevcount)
! 			fprintlog(f, 0, (char *)NULL, f->f_prevfac,
! 				  f->f_prevpri);
  
  		switch (f->f_type) {
  		  case F_FILE:

home help back first fref pref prev next nref lref last post