From: lteo Date: Fri, 16 Jan 2015 04:03:04 +0000 (+0000) Subject: Rename pcap_create()'s ebuf argument to errbuf to match the rest of the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2dbbb255089307bda6443037be1a082d3dc357ae;p=openbsd Rename pcap_create()'s ebuf argument to errbuf to match the rest of the public pcap_* functions that use errbuf. Mainline libpcap also uses "errbuf" for pcap_create(). No object file change. --- diff --git a/lib/libpcap/pcap-bpf.c b/lib/libpcap/pcap-bpf.c index d3184d2ee10..ba8e4606962 100644 --- a/lib/libpcap/pcap-bpf.c +++ b/lib/libpcap/pcap-bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcap-bpf.c,v 1.26 2015/01/16 03:19:57 lteo Exp $ */ +/* $OpenBSD: pcap-bpf.c,v 1.27 2015/01/16 04:03:04 lteo Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996, 1998 @@ -890,13 +890,13 @@ find_802_11(struct bpf_dltlist *bdlp) } pcap_t * -pcap_create(const char *device, char *ebuf) +pcap_create(const char *device, char *errbuf) { pcap_t *p; p = calloc(1, sizeof(*p)); if (p == NULL) { - snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s", + snprintf(errbuf, PCAP_ERRBUF_SIZE, "malloc: %s", pcap_strerror(errno)); return (NULL); } @@ -904,7 +904,7 @@ pcap_create(const char *device, char *ebuf) p->opt.source = strdup(device); if (p->opt.source == NULL) { - snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s", + snprintf(errbuf, PCAP_ERRBUF_SIZE, "malloc: %s", pcap_strerror(errno)); free(p); return (NULL); diff --git a/lib/libpcap/pcap.3 b/lib/libpcap/pcap.3 index 52fe29a25e5..b8718951357 100644 --- a/lib/libpcap/pcap.3 +++ b/lib/libpcap/pcap.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pcap.3,v 1.39 2015/01/16 03:37:10 lteo Exp $ +.\" $OpenBSD: pcap.3,v 1.40 2015/01/16 04:03:04 lteo Exp $ .\" .\" Copyright (c) 1994, 1996, 1997 .\" The Regents of the University of California. All rights reserved. @@ -122,7 +122,7 @@ .Ft int .Fn pcap_datalink_name_to_val "const char *name" .Ft "pcap_t *" -.Fn pcap_create "const char *device" "char *ebuf" +.Fn pcap_create "const char *device" "char *errbuf" .Ft int .Fn pcap_set_snaplen "pcap_t *p" "int snaplen" .Ft int