aboutsummaryrefslogtreecommitdiffstats
path: root/capture_sync.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-05-26 05:33:57 +0000
committerGuy Harris <guy@alum.mit.edu>2010-05-26 05:33:57 +0000
commit5c27494bd6ddc4b3eabb7e0e4316a9fa55a25ae5 (patch)
tree45c931c650ad2a86e79401db5ae5fe7214033e3d /capture_sync.c
parentb0bfae2a8503c5a1f03ea44906a120e511ba4cf6 (diff)
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.c30
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. */