diff options
Diffstat (limited to 'pcap-bt-monitor-linux.c')
-rw-r--r-- | pcap-bt-monitor-linux.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/pcap-bt-monitor-linux.c b/pcap-bt-monitor-linux.c index 8dd9b42e..cee34bcd 100644 --- a/pcap-bt-monitor-linux.c +++ b/pcap-bt-monitor-linux.c @@ -110,8 +110,8 @@ bt_monitor_read(pcap_t *handle, int max_packets _U_, pcap_handler callback, u_ch } while ((ret == -1) && (errno == EINTR)); if (ret < 0) { - pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, - "Can't receive packet: %s", strerror(errno)); + pcap_fmt_errmsg_for_errno(handle->errbuf, PCAP_ERRBUF_SIZE, + errno, "Can't receive packet"); return -1; } @@ -198,15 +198,15 @@ bt_monitor_activate(pcap_t* handle) handle->fd = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); if (handle->fd < 0) { - pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, - "Can't create raw socket: %s", strerror(errno)); + pcap_fmt_errmsg_for_errno(handle->errbuf, PCAP_ERRBUF_SIZE, + errno, "Can't create raw socket"); return PCAP_ERROR; } handle->buffer = malloc(handle->bufsize); if (!handle->buffer) { - pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't allocate dump buffer: %s", - pcap_strerror(errno)); + pcap_fmt_errmsg_for_errno(handle->errbuf, PCAP_ERRBUF_SIZE, + errno, "Can't allocate dump buffer"); goto close_fail; } @@ -216,15 +216,15 @@ bt_monitor_activate(pcap_t* handle) addr.hci_channel = HCI_CHANNEL_MONITOR; if (bind(handle->fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) { - pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, - "Can't attach to interface: %s", strerror(errno)); + pcap_fmt_errmsg_for_errno(handle->errbuf, PCAP_ERRBUF_SIZE, + errno, "Can't attach to interface"); goto close_fail; } opt = 1; if (setsockopt(handle->fd, SOL_SOCKET, SO_TIMESTAMP, &opt, sizeof(opt)) < 0) { - pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, - "Can't enable time stamp: %s", strerror(errno)); + pcap_fmt_errmsg_for_errno(handle->errbuf, PCAP_ERRBUF_SIZE, + errno, "Can't enable time stamp"); goto close_fail; } |