- execute_command(args, username, password, lttd_path, fac_path);
-
+ int retval = execute_command(args, username, password, lttd_path, fac_path);
+
+ if(retval) {
+ gchar msg[256];
+ guint msg_left = 256;
+
+ strcpy(msg, "A problem occured when executing the su command : ");
+ msg_left = 256 - strlen(msg) - 1;
+ strncat(msg, strerror(retval), msg_left);
+ GtkWidget *dialogue =
+ gtk_message_dialog_new(
+ GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(button))),
+ GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_OK,
+ msg);
+ gtk_dialog_run(GTK_DIALOG(dialogue));
+ gtk_widget_destroy(dialogue);
+ }