[network-manager-openconnect/NM_0_8] Fix compiler warnings about ignoring return value from pipe() and write()



commit 9f561809b1445bca20a6ef1b6f77debac1592ad0
Author: David Woodhouse <David Woodhouse intel com>
Date:   Mon May 21 13:47:38 2012 +0100

    Fix compiler warnings about ignoring return value from pipe() and write()
    
    Not that we can really do much, but we can at least shut the compiler up.
    (cherry picked from commit de9f32757689d9e8dbeed2557a39e7e6cf71dc1b)
    
    Conflicts:
    	auth-dialog/main.c

 auth-dialog/main.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index dd1a61d..2dc55af 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -1284,7 +1284,9 @@ static void dialog_response (GtkDialog *dialog, int response, auth_ui_data *ui_d
 {
 	switch (response) {
 	case AUTH_DIALOG_RESPONSE_CANCEL:
-		write(ui_data->cancel_pipes[1], "x", 1);
+		if (write(ui_data->cancel_pipes[1], "x", 1)) {
+			/* Pfft. Not a lot we can do about it */
+		}
 		/* Fall through... */
 	case AUTH_DIALOG_RESPONSE_LOGIN:
 		ssl_box_clear(ui_data);
@@ -1448,7 +1450,13 @@ static auth_ui_data *init_ui_data (char *vpn_name)
 	ui_data->form_shown_changed = g_cond_new();
 	ui_data->cert_response_changed = g_cond_new();
 	ui_data->vpn_name = vpn_name;
-	pipe(ui_data->cancel_pipes);
+	if (pipe(ui_data->cancel_pipes)) {
+		/* This should never happen, and the world is probably about
+		   to come crashing down around our ears. But attempt to cope
+		   by just disabling the cancellation support... */
+		ui_data->cancel_pipes[0] = -1;
+		ui_data->cancel_pipes[1] = -1;
+	}
 	g_unix_set_fd_nonblocking(ui_data->cancel_pipes[0], TRUE, NULL);
 	g_unix_set_fd_nonblocking(ui_data->cancel_pipes[1], TRUE, NULL);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]