From owner-freebsd-hackers Tue Jan 16 23: 2:11 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id 140E137B400 for ; Tue, 16 Jan 2001 23:01:54 -0800 (PST) Received: (from eric@localhost) by meow.osd.bsdi.com (8.11.1/8.9.3) id f0H707T27096 for freebsd-hackers@freebsd.org; Tue, 16 Jan 2001 23:00:07 -0800 (PST) (envelope-from eric) Date: Tue, 16 Jan 2001 23:00:07 -0800 From: Eric Melville To: freebsd-hackers@freebsd.org Subject: syslogd patch Message-ID: <20010116230007.A27043@meow.osd.bsdi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Printing out the whole path to the kernel all the time in syslog messages is a bit redundant and ugly, especially seeing that it isn't done for any other binaries. Should I send-pr this thing too, or is just sending it to -hackers enough? --- usr/src/usr.sbin/syslogd/syslogd.c.old Sat Jan 13 21:20:28 2001 +++ usr/src/usr.sbin/syslogd/syslogd.c Sat Jan 13 22:27:44 2001 @@ -734,8 +734,8 @@ int flags; { struct filed *f; - int i, fac, msglen, omask, prilev; - char *timestamp; + int i, fac, msglen, omask, prilev, bflen; + char *timestamp, *bfshort; char prog[NAME_MAX+1]; char buf[MAXLINE+1]; @@ -784,7 +784,16 @@ /* add kernel prefix for kernel messages */ if (flags & ISKERNEL) { - snprintf(buf, sizeof(buf), "%s: %s", bootfile, msg); + /* ignore path to kernel */ + bflen = strlen(bootfile); + bfshort = bootfile; + while(bflen--) + if(*(bootfile+bflen) == '/') + { + bfshort = bootfile+bflen+1; + break; + } + snprintf(buf, sizeof(buf), "%s: %s", bfshort, msg); msg = buf; msglen = strlen(buf); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message