git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f3a93b5
)
socket_wrapper: fix PCAP support broken by aaea68791cfea45c6fa69abc93ad6d0e832d0283
author
Stefan Metzmacher
<metze@samba.org>
Tue, 20 Jan 2009 00:37:53 +0000
(16:37 -0800)
committer
Karolin Seeger
<kseeger@samba.org>
Tue, 20 Jan 2009 13:16:51 +0000
(14:16 +0100)
We should not close the fd after writing the first packet.
metze
(cherry picked from commit
53e8f92678428a0c3cbeefa83219609661d28831
)
source/lib/socket_wrapper/socket_wrapper.c
patch
|
blob
|
history
diff --git
a/source/lib/socket_wrapper/socket_wrapper.c
b/source/lib/socket_wrapper/socket_wrapper.c
index cee43c06a50a224adf91f22dd792fdcd8ffd2c9b..7b7306114223b6b1746e9a62eac7e8f4a76a2130 100644
(file)
--- a/
source/lib/socket_wrapper/socket_wrapper.c
+++ b/
source/lib/socket_wrapper/socket_wrapper.c
@@
-901,7
+901,7
@@
static int swrap_get_pcap_fd(const char *fname)
if (write(fd, &file_hdr, sizeof(file_hdr)) != sizeof(file_hdr)) {
close(fd);
-
return
-1;
+
fd =
-1;
}
return fd;
}
@@
-1194,11
+1194,9
@@
static void swrap_dump_packet(struct socket_info *si,
fd = swrap_get_pcap_fd(file_name);
if (fd != -1) {
if (write(fd, packet, packet_len) != packet_len) {
- close(fd);
free(packet);
return;
}
- close(fd);
}
free(packet);