summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2005-11-13 19:37:51 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2005-11-13 19:37:51 +0000
commit9399d1a53c993ec540eb28f92724822f98e95a5c (patch)
tree1a2baa8c55cbad29d282ff95afdf4dd0baa031c0
parent694f33bb1782b9face609672619169e5ac26d7bf (diff)
Do not clobber errno, from Andrey Matveev. ok canacar@
-rw-r--r--usr.sbin/tcpdump/privsep_pcap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/tcpdump/privsep_pcap.c b/usr.sbin/tcpdump/privsep_pcap.c
index 685fe344720..ee4c3b1e5d8 100644
--- a/usr.sbin/tcpdump/privsep_pcap.c
+++ b/usr.sbin/tcpdump/privsep_pcap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep_pcap.c,v 1.13 2005/10/16 18:23:45 otto Exp $ */
+/* $OpenBSD: privsep_pcap.c,v 1.14 2005/11/13 19:37:50 otto Exp $ */
/*
* Copyright (c) 2004 Can Erkin Acar
@@ -382,10 +382,10 @@ priv_pcap_offline(const char *fname, char *errbuf)
fp = fdopen(p->fd, "r");
if (fp == NULL) {
- close(p->fd);
- p->fd = -1;
snprintf(errbuf, PCAP_ERRBUF_SIZE, "%s: %s", fname,
pcap_strerror(errno));
+ close(p->fd);
+ p->fd = -1;
goto bad;
}
}
@@ -503,9 +503,9 @@ priv_pcap_dump_open(pcap_t *p, char *fname)
}
f = fdopen(fd, "w");
if (f == NULL) {
- close(fd);
snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "%s: %s",
fname, pcap_strerror(errno));
+ close(fd);
return (NULL);
}
}