diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-05-26 05:33:57 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-05-26 05:33:57 +0000 |
commit | 2e7751a5edae31e37b4bec54c526d278e3d888aa (patch) | |
tree | 45c931c650ad2a86e79401db5ae5fe7214033e3d /capture_sync.c | |
parent | 59931237c30bc59b1980f7a1874e6fc60e8f075b (diff) |
Don't report EINTR - it might be from a ^C.
Do report the error string for other read errors, though.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32969 f5534014-38df-0310-8fa8-9805f1628bb7
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. */ |