summaryrefslogtreecommitdiff
path: root/dumpcap.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2017-01-30 12:52:35 -0800
committerGerald Combs <gerald@wireshark.org>2017-01-30 23:56:08 +0000
commitbd86a45006c20bcce4e5754fc575363ab7b33f66 (patch)
treebd064f2bd9d46547eb0c2d57231079ff7592d584 /dumpcap.c
parentd5b053d26c2e7638d6d35af97b4c8c7b7fe9f3ea (diff)
downloadwireshark-bd86a45006c20bcce4e5754fc575363ab7b33f66.tar.gz
Dumpcap: Improve an error message.
Dumpcap doesn't yet support capturing pcapng from stdin. On Windows, make sure we invalidate our file handle so that instead of printing "Error reading from pipe: The operation completed successfully. (error 0)" we show the more useful "Capturing from a pipe doesn't support pcapng format." Change-Id: I472c1bf5c8520c9ee3fe4b6299a6e0250262ea51 Reviewed-on: https://code.wireshark.org/review/19876 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 632dda33f8..6f07b63225 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -1849,6 +1849,9 @@ error:
pcap_opts->cap_pipe_err = PIPERR;
cap_pipe_close(fd, pcap_opts->from_cap_socket);
pcap_opts->cap_pipe_fd = -1;
+#ifdef _WIN32
+ pcap_opts->cap_pipe_h = INVALID_HANDLE_VALUE;
+#endif
}