diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2011-05-27 10:29:47 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-05-27 10:29:47 -0700 |
commit | 2c0adb475a10db81f76266e8bd1a860b8dc0cc3d (patch) | |
tree | 8eab6d0708396d89728fdfcdd076e15394611cc5 | |
parent | c084aeb54a27325f1b4dc2c8281e51c0f197e4b4 (diff) | |
download | connman-2c0adb475a10db81f76266e8bd1a860b8dc0cc3d.tar.gz connman-2c0adb475a10db81f76266e8bd1a860b8dc0cc3d.tar.bz2 connman-2c0adb475a10db81f76266e8bd1a860b8dc0cc3d.zip |
tools: Fix unused variable warnings for WISPr client
-rw-r--r-- | tools/wispr.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/wispr.c b/tools/wispr.c index a0002ba3..0792f5b1 100644 --- a/tools/wispr.c +++ b/tools/wispr.c @@ -307,10 +307,14 @@ struct user_input_data { static void user_callback(struct user_input_data *data) { char *value; - int len; - if (data->hidden == TRUE) + if (data->hidden == TRUE) { + ssize_t len; + len = write(data->fd, "\n", 1); + if (len < 0) + return; + } tcsetattr(data->fd, TCSADRAIN, &data->saved_termios); @@ -358,7 +362,7 @@ static gboolean user_input(const char *label, gboolean hidden, struct termios new_termios; GIOChannel *channel; guint watch; - int len; + ssize_t len; data = g_try_new0(struct user_input_data, 1); if (data == NULL) @@ -398,7 +402,12 @@ static gboolean user_input(const char *label, gboolean hidden, goto error; len = write(data->fd, label, strlen(label)); + if (len < 0) + goto error; + len = write(data->fd, ": ", 2); + if (len < 0) + goto error; return TRUE; |