Deleted Added
full compact
pjdlog.c (213939) pjdlog.c (217731)
1/*-
2 * Copyright (c) 2009-2010 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Pawel Jakub Dawidek under sponsorship from
6 * the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2009-2010 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Pawel Jakub Dawidek under sponsorship from
6 * the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sbin/hastd/pjdlog.c 213939 2010-10-16 22:50:12Z pjd $");
31__FBSDID("$FreeBSD: head/sbin/hastd/pjdlog.c 217731 2011-01-22 22:35:08Z pjd $");
32
33#include <assert.h>
34#include <errno.h>
35#include <stdarg.h>
36#include <stdio.h>
37#include <stdlib.h>
38#include <string.h>
39#include <syslog.h>

--- 60 unchanged lines hidden (view full) ---

100 * Setting prefix to NULL will remove it.
101 */
102void
103pjdlog_prefix_set(const char *fmt, ...)
104{
105 va_list ap;
106
107 va_start(ap, fmt);
32
33#include <assert.h>
34#include <errno.h>
35#include <stdarg.h>
36#include <stdio.h>
37#include <stdlib.h>
38#include <string.h>
39#include <syslog.h>

--- 60 unchanged lines hidden (view full) ---

100 * Setting prefix to NULL will remove it.
101 */
102void
103pjdlog_prefix_set(const char *fmt, ...)
104{
105 va_list ap;
106
107 va_start(ap, fmt);
108 pjdlog_prefix_setv(fmt, ap);
108 pjdlogv_prefix_set(fmt, ap);
109 va_end(ap);
110}
111
112/*
113 * Set prefix that will be used before each log.
114 * Setting prefix to NULL will remove it.
115 */
116void
109 va_end(ap);
110}
111
112/*
113 * Set prefix that will be used before each log.
114 * Setting prefix to NULL will remove it.
115 */
116void
117pjdlog_prefix_setv(const char *fmt, va_list ap)
117pjdlogv_prefix_set(const char *fmt, va_list ap)
118{
119
120 assert(fmt != NULL);
121
122 vsnprintf(pjdlog_prefix, sizeof(pjdlog_prefix), fmt, ap);
123}
124
125/*

--- 265 unchanged lines hidden ---
118{
119
120 assert(fmt != NULL);
121
122 vsnprintf(pjdlog_prefix, sizeof(pjdlog_prefix), fmt, ap);
123}
124
125/*

--- 265 unchanged lines hidden ---