=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rdist/message.c,v retrieving revision 1.6 retrieving revision 1.7 diff -c -r1.6 -r1.7 *** src/usr.bin/rdist/message.c 1996/07/29 17:50:09 1.6 --- src/usr.bin/rdist/message.c 1998/06/26 21:21:15 1.7 *************** *** 1,4 **** ! /* $OpenBSD: message.c,v 1.6 1996/07/29 17:50:09 millert Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. --- 1,4 ---- ! /* $OpenBSD: message.c,v 1.7 1998/06/26 21:21:15 millert Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. *************** *** 34,41 **** */ #ifndef lint static char RCSid[] = ! "$OpenBSD: message.c,v 1.6 1996/07/29 17:50:09 millert Exp $"; static char sccsid[] = "@(#)common.c"; --- 34,46 ---- */ #ifndef lint + #if 0 static char RCSid[] = ! "$From: message.c,v 6.24 1996/07/19 17:00:35 michaelc Exp $"; ! #else ! static char RCSid[] = ! "$OpenBSD: message.c,v 1.7 1998/06/26 21:21:15 millert Exp $"; ! #endif static char sccsid[] = "@(#)common.c"; *************** *** 145,151 **** if (strcasecmp(name, msgfacility[i].mf_name) == 0) return(&msgfacility[i]); ! return((MSGFACILITY *) NULL); } /* --- 150,156 ---- if (strcasecmp(name, msgfacility[i].mf_name) == 0) return(&msgfacility[i]); ! return(NULL); } /* *************** *** 160,166 **** if (strcasecmp(name, msgtypes[i].mt_name) == 0) return(&msgtypes[i]); ! return((MSGTYPE *) NULL); } /* --- 165,171 ---- if (strcasecmp(name, msgtypes[i].mt_name) == 0) return(&msgtypes[i]); ! return(NULL); } /* *************** *** 183,189 **** msgfac->mf_msgfac != MF_FILE)) { (void) snprintf(ebuf, sizeof(ebuf), "The \"%s\" message facility cannot be used by the server.", ! msgfac->mf_name); return(ebuf); } --- 188,194 ---- msgfac->mf_msgfac != MF_FILE)) { (void) snprintf(ebuf, sizeof(ebuf), "The \"%s\" message facility cannot be used by the server.", ! msgfac->mf_name); return(ebuf); } *************** *** 234,244 **** msgfac->mf_msgtypes = 0; /* Start from scratch */ while (strptr) { word = strptr; ! if (cp = strchr(strptr, ',')) *cp++ = CNULL; strptr = cp; ! if (mtp = getmsgtype(word)) { msgfac->mf_msgtypes |= mtp->mt_type; /* * XXX This is really a kludge until we add real --- 239,249 ---- msgfac->mf_msgtypes = 0; /* Start from scratch */ while (strptr) { word = strptr; ! if ((cp = strchr(strptr, ','))) *cp++ = CNULL; strptr = cp; ! if ((mtp = getmsgtype(word))) { msgfac->mf_msgtypes |= mtp->mt_type; /* * XXX This is really a kludge until we add real *************** *** 255,261 **** } } ! return((char *) NULL); } /* --- 260,266 ---- } } ! return(NULL); } /* *************** *** 280,286 **** * Each = list is seperated by ":". */ for (optstr = strtok(msgbuf, ":"); optstr; ! optstr = strtok((char *)NULL, ":")) { if ((cp = strchr(optstr, '=')) == NULL) return("No '=' found"); --- 285,291 ---- * Each = list is seperated by ":". */ for (optstr = strtok(msgbuf, ":"); optstr; ! optstr = strtok(NULL, ":")) { if ((cp = strchr(optstr, '=')) == NULL) return("No '=' found"); *************** *** 302,308 **** if (doset) { char *mcp; ! if (mcp = setmsgtypes(msgfac, cp)) return(mcp); } } --- 307,313 ---- if (doset) { char *mcp; ! if ((mcp = setmsgtypes(msgfac, cp))) return(mcp); } } *************** *** 312,318 **** msgprconfig(); } ! return((char *) NULL); } /* --- 317,323 ---- msgprconfig(); } ! return(NULL); } /* *************** *** 457,469 **** if (!msgfac->mf_fptr) { register char *cp; - char *getenv(); int fd; /* * Create and open a new temporary file */ ! if ((cp = getenv("TMPDIR")) == (char *) NULL) cp = _PATH_TMP; tempfile = (char *) xmalloc(strlen(cp) + 1 + strlen(_RDIST_TMP) + 2); --- 462,474 ---- if (!msgfac->mf_fptr) { register char *cp; int fd; + char *getenv(); /* * Create and open a new temporary file */ ! if ((cp = getenv("TMPDIR")) == NULL) cp = _PATH_TMP; tempfile = (char *) xmalloc(strlen(cp) + 1 + strlen(_RDIST_TMP) + 2); *************** *** 521,527 **** /* * Ensure no stray newlines are present */ ! if (cp = strchr(msgbuf, '\n')) *cp = CNULL; checkhostname(); --- 526,532 ---- /* * Ensure no stray newlines are present */ ! if ((cp = strchr(msgbuf, '\n'))) *cp = CNULL; checkhostname(); *************** *** 537,543 **** * logged to the system log facility */ if (IS_ON(flags, MT_SYSLOG)) { ! msgsendsyslog((MSGFACILITY *)NULL, MT_SYSLOG, flags, mbuf); return; } --- 542,548 ---- * logged to the system log facility */ if (IS_ON(flags, MT_SYSLOG)) { ! msgsendsyslog(NULL, MT_SYSLOG, flags, mbuf); return; } *************** *** 545,558 **** * Special cases */ if (isserver && IS_ON(flags, MT_NOTICE)) { ! msgsendstdout((MSGFACILITY *)NULL, MT_NOTICE, flags, mbuf); return; } else if (isserver && IS_ON(flags, MT_REMOTE)) ! msgsendstdout((MSGFACILITY *)NULL, MT_REMOTE, flags, mbuf); else if (isserver && IS_ON(flags, MT_NERROR)) ! msgsendstdout((MSGFACILITY *)NULL, MT_NERROR, flags, mbuf); else if (isserver && IS_ON(flags, MT_FERROR)) ! msgsendstdout((MSGFACILITY *)NULL, MT_FERROR, flags, mbuf); /* * For each Message Facility, check each Message Type to see --- 550,563 ---- * Special cases */ if (isserver && IS_ON(flags, MT_NOTICE)) { ! msgsendstdout(NULL, MT_NOTICE, flags, mbuf); return; } else if (isserver && IS_ON(flags, MT_REMOTE)) ! msgsendstdout(NULL, MT_REMOTE, flags, mbuf); else if (isserver && IS_ON(flags, MT_NERROR)) ! msgsendstdout(NULL, MT_NERROR, flags, mbuf); else if (isserver && IS_ON(flags, MT_FERROR)) ! msgsendstdout(NULL, MT_FERROR, flags, mbuf); /* * For each Message Facility, check each Message Type to see *************** *** 871,875 **** return(msgfacility[i].mf_filename); } ! return((char *) NULL); } --- 876,880 ---- return(msgfacility[i].mf_filename); } ! return(NULL); }