kov changed libgksu/branches/libgksu2/libgksu/ChangeLog, libgksu/branches/libgksu2/libgksu/libgksu.c, libgksu/branches/libgksu2/libgksu/test-gksu.c

Gustavo Noronha kov at costa.debian.org
Sun Apr 23 15:50:26 UTC 2006


Mensagem de log: 
display message before testing gksu_sudo_full, so we
get a better picture of where stuff is happening

use non-blocking read when looking for the sudo prompt,
so that we won't get blocked if there is none; also,
make sure the window is displayed


-----


Modified: libgksu/branches/libgksu2/libgksu/ChangeLog
===================================================================
--- libgksu/branches/libgksu2/libgksu/ChangeLog	2006-04-23 15:23:09 UTC (rev 553)
+++ libgksu/branches/libgksu2/libgksu/ChangeLog	2006-04-23 15:50:25 UTC (rev 554)
@@ -1,6 +1,15 @@
 2006-04-23  Gustavo Noronha Silva  <kov at debian.org>
 
+	* test-gksu.c:
+	- display message before testing gksu_sudo_full, so we
+	  get a better picture of where stuff is happening
+
 	* libgksu.c:
+	- use non-blocking read when looking for the sudo prompt,
+	  so that we won't get blocked if there is none; also,
+	  make sure the window is displayed
+
+	* libgksu.c:
 	- only print the password when on debug mode
 
 	* libgksu.c:

Modified: libgksu/branches/libgksu2/libgksu/libgksu.c
===================================================================
--- libgksu/branches/libgksu2/libgksu/libgksu.c	2006-04-23 15:23:09 UTC (rev 553)
+++ libgksu/branches/libgksu2/libgksu/libgksu.c	2006-04-23 15:50:25 UTC (rev 554)
@@ -1632,7 +1632,14 @@
 
 	  /* configuration tells us to show this message */
 	  if (should_display)
-	    pass_not_needed (context, pass_not_needed_data);
+	    {
+	      if (context->debug)
+		fprintf (stderr, "Calling pass_not_needed window...\n");
+	      pass_not_needed (context, pass_not_needed_data);
+	      /* make sure it is displayed */
+	      while (gtk_events_pending ())
+		gtk_main_iteration ();
+	    }
 	}
 
       if (context->debug)
@@ -2091,6 +2098,7 @@
 	if we don't there are two possibilities: an error
 	or a password is not needed
       */
+      fcntl (parent_pipe[0], F_SETFL, O_NONBLOCK);
       r = read(parent_pipe[0], buffer, 16);
 
       if (context->debug)
@@ -2137,7 +2145,14 @@
 
 	  /* configuration tells us to show this message */
 	  if (should_display)
-	    pass_not_needed (context, pass_not_needed_data);
+	    {
+	      if (context->debug)
+		fprintf (stderr, "Calling pass_not_needed window...\n");
+	      pass_not_needed (context, pass_not_needed_data);
+	      /* make sure it is displayed */
+	      while (gtk_events_pending ())
+		gtk_main_iteration ();
+	    }
 
 	  fprintf (stderr, "%s", buffer);
 	}

Modified: libgksu/branches/libgksu2/libgksu/test-gksu.c
===================================================================
--- libgksu/branches/libgksu2/libgksu/test-gksu.c	2006-04-23 15:23:09 UTC (rev 553)
+++ libgksu/branches/libgksu2/libgksu/test-gksu.c	2006-04-23 15:50:25 UTC (rev 554)
@@ -85,6 +85,7 @@
       if (error)
 	fprintf (stderr, "gksu_sudo failed: %s\n", error->message);
 
+      printf ("Testing gksu_sudo_full...\n");
       error = NULL;
       gksu_sudo_full (context,
 		      su_ask_pass, NULL,




More information about the gksu-commits mailing list