syslog.c (237523) | syslog.c (241046) |
---|---|
1/* 2 * Copyright (c) 1983, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#if defined(LIBC_SCCS) && !defined(lint) 31static char sccsid[] = "@(#)syslog.c 8.5 (Berkeley) 4/29/95"; 32#endif /* LIBC_SCCS and not lint */ 33#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1983, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#if defined(LIBC_SCCS) && !defined(lint) 31static char sccsid[] = "@(#)syslog.c 8.5 (Berkeley) 4/29/95"; 32#endif /* LIBC_SCCS and not lint */ 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/lib/libc/gen/syslog.c 237523 2012-06-24 07:03:22Z eadler $"); | 34__FBSDID("$FreeBSD: head/lib/libc/gen/syslog.c 241046 2012-09-29 11:54:34Z jilles $"); |
35 36#include "namespace.h" 37#include <sys/types.h> 38#include <sys/socket.h> 39#include <sys/syslog.h> 40#include <sys/uio.h> 41#include <sys/un.h> 42#include <netdb.h> --- 252 unchanged lines hidden (view full) --- 295 } 296 297 /* 298 * Output the message to the console; try not to block 299 * as a blocking console should not stop other processes. 300 * Make sure the error reported is the one from the syslogd failure. 301 */ 302 if (LogStat & LOG_CONS && | 35 36#include "namespace.h" 37#include <sys/types.h> 38#include <sys/socket.h> 39#include <sys/syslog.h> 40#include <sys/uio.h> 41#include <sys/un.h> 42#include <netdb.h> --- 252 unchanged lines hidden (view full) --- 295 } 296 297 /* 298 * Output the message to the console; try not to block 299 * as a blocking console should not stop other processes. 300 * Make sure the error reported is the one from the syslogd failure. 301 */ 302 if (LogStat & LOG_CONS && |
303 (fd = _open(_PATH_CONSOLE, O_WRONLY|O_NONBLOCK, 0)) >= 0) { | 303 (fd = _open(_PATH_CONSOLE, O_WRONLY|O_NONBLOCK|O_CLOEXEC, 0)) >= 304 0) { |
304 struct iovec iov[2]; 305 struct iovec *v = iov; 306 307 p = strchr(tbuf, '>') + 1; 308 v->iov_base = p; 309 v->iov_len = cnt - (p - tbuf); 310 ++v; 311 v->iov_base = "\r\n"; --- 126 unchanged lines hidden --- | 305 struct iovec iov[2]; 306 struct iovec *v = iov; 307 308 p = strchr(tbuf, '>') + 1; 309 v->iov_base = p; 310 v->iov_len = cnt - (p - tbuf); 311 ++v; 312 v->iov_base = "\r\n"; --- 126 unchanged lines hidden --- |