From owner-cvs-lib Fri May 1 00:13:15 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA12332 for cvs-lib-outgoing; Fri, 1 May 1998 00:13:15 -0700 (PDT) (envelope-from owner-cvs-lib) Received: from awfulhak.org (awfulhak.demon.co.uk [158.152.17.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA12323; Fri, 1 May 1998 00:12:58 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from gate.lan.awfulhak.org (localhost [127.0.0.1]) by awfulhak.org (8.8.8/8.8.8) with ESMTP id IAA13082; Fri, 1 May 1998 08:06:35 +0100 (BST) (envelope-from brian@gate.lan.awfulhak.org) Message-Id: <199805010706.IAA13082@awfulhak.org> X-Mailer: exmh version 2.0.1 12/23/97 To: Bruce Evans cc: brian@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/gen syslog.c In-reply-to: Your message of "Fri, 01 May 1998 13:17:29 +1000." <199805010317.NAA29322@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 01 May 1998 08:06:35 +0100 From: Brian Somers Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > Modified files: > > lib/libc/gen syslog.c > > Log: > > connect() returns -1 on error - not 0. > > Strangely enough, the code already tested for connect() returning -1 > on error. -1/other is converted to the boolean variable `connected'. > The change seems to amount to an obfuscation if this variable (`true' > changed from 1 to 0 and `false' changed from 0 to -1). I'm not sure I follow. Surely the old code would never normally open /dev/log as it tested for a return of 0 from connect(). Also, if someone does an openlog() after closing STDIN_FILENO, they'll attach STDIN_FILENO to /var/run/log and attempt to open /dev/log (getting a new descriptor and using that if they succeed). > Bruce > -- Brian , , Don't _EVER_ lose your sense of humour....