summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1998-05-01 01:16:39 +0000
committerbrian <brian@FreeBSD.org>1998-05-01 01:16:39 +0000
commit2291918271762e5ad54b820cbc06f74c56085a8b (patch)
tree4e1430b7471b64565b9812df0174edddcb1ceb4e /lib/libc/gen
parentab20b86639ba0623a32cd8d4b4049b9050c95584 (diff)
downloadFreeBSD-src-2291918271762e5ad54b820cbc06f74c56085a8b.zip
FreeBSD-src-2291918271762e5ad54b820cbc06f74c56085a8b.tar.gz
connect() returns -1 on error - not 0.
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/syslog.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c
index bb5b023..a55bfa6 100644
--- a/lib/libc/gen/syslog.c
+++ b/lib/libc/gen/syslog.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)syslog.c 8.5 (Berkeley) 4/29/95";
*/
static const char rcsid[] =
- "$Id: syslog.c,v 1.15 1998/03/06 02:12:02 brian Exp $";
+ "$Id: syslog.c,v 1.16 1998/03/06 03:10:49 brian Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -61,7 +61,7 @@ static const char rcsid[] =
#endif
static int LogFile = -1; /* fd for log */
-static int connected; /* have done connect */
+static int connected = -1; /* have done connect */
static int opened; /* have done openlog() */
static int LogStat = 0; /* status bits, set by openlog() */
static const char *LogTag = NULL; /* string to tag the entry with */
@@ -286,7 +286,7 @@ disconnectlog()
close(LogFile);
LogFile = -1;
}
- connected = 0; /* retry connect */
+ connected = -1; /* retry connect */
}
static void
@@ -299,7 +299,7 @@ connectlog()
return;
(void)fcntl(LogFile, F_SETFD, 1);
}
- if (LogFile != -1 && !connected) {
+ if (LogFile != -1 && connected == -1) {
SyslogAddr.sun_len = sizeof(SyslogAddr);
SyslogAddr.sun_family = AF_UNIX;
(void)strncpy(SyslogAddr.sun_path, _PATH_LOG,
@@ -307,7 +307,7 @@ connectlog()
connected = connect(LogFile, (struct sockaddr *)&SyslogAddr,
sizeof(SyslogAddr)) != -1;
- if (!connected) {
+ if (connected == -1) {
/*
* Try the old "/dev/log" path, for backward
* compatibility.
@@ -319,7 +319,7 @@ connectlog()
sizeof(SyslogAddr)) != -1;
}
- if (!connected) {
+ if (connected == -1) {
(void)close(LogFile);
LogFile = -1;
}
@@ -348,7 +348,7 @@ closelog()
{
(void)close(LogFile);
LogFile = -1;
- connected = 0;
+ connected = -1;
}
/* setlogmask -- set the log mask level */
OpenPOWER on IntegriCloud