Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 May 1998 17:31:07 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, brian@Awfulhak.org
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
Message-ID:  <199805010731.RAA09278@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> >  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 

It didn't test for a return of 0 from connect:

		connected = connect(LogFile, (struct sockaddr *)&SyslogAddr,
			sizeof(SyslogAddr)) != -1;

This tests for a return of -1 from connect() and assigns the result of the
test to `connected'.

Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805010731.RAA09278>