summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2012-03-27 22:19:07 +0200
committerGuido Günther <agx@sigxcpu.org>2012-03-27 22:43:56 +0200
commitb6221157e64d050aebb89e9806c830b70c2667fc (patch)
treef48b2837e47d98772a7c92cef0c00a3338012125 /src
parentfe51938087074b9a4ada8a08c27ee112ed5593df (diff)
Check password write result
to avoid warning.
Diffstat (limited to 'src')
-rw-r--r--src/nm-iodine-service.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nm-iodine-service.c b/src/nm-iodine-service.c
index 03012f8..b381906 100644
--- a/src/nm-iodine-service.c
+++ b/src/nm-iodine-service.c
@@ -440,14 +440,19 @@ static void
send_password(gint fd, NMSettingVPN *s_vpn)
{
const char *passwd;
+ ssize_t ret;
passwd = nm_setting_vpn_get_secret (s_vpn, NM_IODINE_KEY_PASSWORD);
/* Don't send an empty password since this makes iodine block */
if (!passwd || !strlen(passwd))
passwd = "<none>";
- write (fd, passwd, strlen(passwd));
- write (fd, "\n", 1);
+ ret = write (fd, passwd, strlen(passwd));
+ if (ret < 0)
+ g_warning("Password write failed");
+ ret = write (fd, "\n", 1);
+ if (ret < 0)
+ g_warning("Password write failed");
}