From 0dcbec93729cea8e3c7e5049fe4907bb874e2f4a Mon Sep 17 00:00:00 2001 From: Robert Love Date: Wed, 4 Jan 2006 17:54:42 +0000 Subject: [PATCH] make a vague attempt at checking write(2)'s error code. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1262 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- gnome/applet/vpn-password-dialog.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnome/applet/vpn-password-dialog.c b/gnome/applet/vpn-password-dialog.c index 5284094320..b1bfca957b 100644 --- a/gnome/applet/vpn-password-dialog.c +++ b/gnome/applet/vpn-password-dialog.c @@ -71,12 +71,12 @@ child_stdout_data_cb (GIOChannel *source, GIOCondition condition, gpointer userd if (++io_user_data->num_newlines == 2) { char buf[1]; /* terminate the child */ - write (io_user_data->child_stdin, buf, sizeof (buf)); - } + if (write (io_user_data->child_stdin, buf, sizeof (buf)) == -1) + goto out; + } } else if (len > 0) { /* remove terminating newline */ str[len - 1] = '\0'; - *passwords = g_slist_append (*passwords, str); } }