diff options
author | Guy Harris <guy@alum.mit.edu> | 2010-05-26 05:33:57 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2010-05-26 05:33:57 +0000 |
commit | 5c27494bd6ddc4b3eabb7e0e4316a9fa55a25ae5 (patch) | |
tree | 45c931c650ad2a86e79401db5ae5fe7214033e3d /capture_sync.c | |
parent | b0bfae2a8503c5a1f03ea44906a120e511ba4cf6 (diff) | |
download | wireshark-5c27494bd6ddc4b3eabb7e0e4316a9fa55a25ae5.tar.gz wireshark-5c27494bd6ddc4b3eabb7e0e4316a9fa55a25ae5.tar.bz2 wireshark-5c27494bd6ddc4b3eabb7e0e4316a9fa55a25ae5.zip |
Don't report EINTR - it might be from a ^C.
Do report the error string for other read errors, though.
svn path=/trunk/; revision=32969
Diffstat (limited to 'capture_sync.c')
-rw-r--r-- | capture_sync.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/capture_sync.c b/capture_sync.c index a3cb248797..d1580bdbad 100644 --- a/capture_sync.c +++ b/capture_sync.c @@ -896,8 +896,14 @@ sync_pipe_run_command(const char** argv, gchar **data, gchar **primary_msg, /* No unusual exit status; just report the read problem. */ if (nread == 0) *primary_msg = g_strdup("Child dumpcap closed sync pipe prematurely"); - else - *primary_msg = g_strdup("Error reading from sync pipe"); + else { + /* Don't report EINTR - that might just be from a ^C. */ + if (errno == EINTR) + *primary_msg = NULL; + else + *primary_msg = g_strdup_printf("Error reading from sync pipe: %s", + strerror(errno)); + } } *secondary_msg = NULL; @@ -1158,8 +1164,14 @@ sync_interface_stats_open(int *data_read_fd, int *fork_child, gchar **msg) /* No unusual exit status; just report the read problem. */ if (nread == 0) *msg = g_strdup("Child dumpcap closed sync pipe prematurely"); - else - *msg = g_strdup("Error reading from sync pipe"); + else { + /* Don't report EINTR - that might just be from a ^C. */ + if (errno == EINTR) + *msg = NULL; + else + *msg = g_strdup_printf("Error reading from sync pipe: %s", + strerror(errno)); + } } return -1; @@ -1431,8 +1443,14 @@ sync_pipe_input_cb(gint source, gpointer user_data) /* No unusual exit status; just report the read problem. */ if (nread == 0) primary_msg = g_strdup("Child dumpcap closed sync pipe prematurely"); - else - primary_msg = g_strdup("Error reading from sync pipe"); + else { + /* Don't report EINTR - that might just be from a ^C. */ + if (errno == EINTR) + primary_msg = NULL; + else + primary_msg = g_strdup_printf("Error reading from sync pipe: %s", + strerror(errno)); + } } /* No more child process. */ |