git.samba.org
/
kai
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
930b3c1
)
socket_wrapper: fix PCAP support broken by aaea68791cfea45c6fa69abc93ad6d0e832d0283
author
Stefan Metzmacher
<metze@samba.org>
Mon, 19 Jan 2009 23:37:57 +0000
(
00:37
+0100)
committer
Stefan Metzmacher
<metze@samba.org>
Mon, 19 Jan 2009 23:42:01 +0000
(
00:42
+0100)
We should note close the fd after writing the first packet.
metze
lib/socket_wrapper/socket_wrapper.c
patch
|
blob
|
history
diff --git
a/lib/socket_wrapper/socket_wrapper.c
b/lib/socket_wrapper/socket_wrapper.c
index dc0124bdb7720572a040ecfe6ce4e1fa540a52f6..1e3927705b215ba85bccd05522f4c70540ca9c00 100644
(file)
--- a/
lib/socket_wrapper/socket_wrapper.c
+++ b/
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);