diff options
author | Gerald Combs <gerald@wireshark.org> | 2017-01-30 12:52:35 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2017-01-30 23:56:08 +0000 |
commit | bd86a45006c20bcce4e5754fc575363ab7b33f66 (patch) | |
tree | bd064f2bd9d46547eb0c2d57231079ff7592d584 /dumpcap.c | |
parent | d5b053d26c2e7638d6d35af97b4c8c7b7fe9f3ea (diff) | |
download | wireshark-bd86a45006c20bcce4e5754fc575363ab7b33f66.tar.gz wireshark-bd86a45006c20bcce4e5754fc575363ab7b33f66.tar.bz2 wireshark-bd86a45006c20bcce4e5754fc575363ab7b33f66.zip |
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 } |