kov changed libgksu/trunk/ChangeLog, libgksu/trunk/libgksu/libgksu.c
Gustavo Noronha
kov at alioth.debian.org
Fri Jun 22 11:25:53 UTC 2007
Mensagem de log:
accepted patch from Ubuntu, by Michael Vogt, that
fixes the way gksu waits for the child process to
finish; see:
https://bugs.launchpad.net/ubuntu/+source/libgksu/+bug/121581
-----
Modified: libgksu/trunk/ChangeLog
===================================================================
--- libgksu/trunk/ChangeLog 2007-06-10 19:05:33 UTC (rev 806)
+++ libgksu/trunk/ChangeLog 2007-06-22 11:25:52 UTC (rev 807)
@@ -1,3 +1,11 @@
+2007-06-22 Gustavo Noronha Silva <kov at debian.org>
+
+ * libgksu/libgksu.c:
+ - accepted patch from Ubuntu, by Michael Vogt, that
+ fixes the way gksu waits for the child process to
+ finish; see:
+ https://bugs.launchpad.net/ubuntu/+source/libgksu/+bug/121581
+
2007-06-10 Gustavo Noronha Silva <kov at debian.org>
* Release 2.0.5
Modified: libgksu/trunk/libgksu/libgksu.c
===================================================================
--- libgksu/trunk/libgksu/libgksu.c 2007-06-10 19:05:33 UTC (rev 806)
+++ libgksu/trunk/libgksu/libgksu.c 2007-06-22 11:25:52 UTC (rev 807)
@@ -2193,7 +2193,8 @@
cmdline = g_strdup("bin/su");
/* wait for the child process to end or become something other
than su */
- while ((!waitpid (pid, &status, WNOHANG)) &&
+ pid_t pid_exited;
+ while ((!(pid_exited = waitpid (pid, &status, WNOHANG))) &&
(g_str_has_suffix(cmdline, "bin/su")))
{
if (cmdline)
@@ -2212,7 +2213,7 @@
bzero(buf, 256);
}
- if (!WIFEXITED(status))
+ if (pid_exited != pid)
waitpid(pid, &status, 0);
if (WEXITSTATUS(status))
@@ -2681,8 +2682,9 @@
cmdline = g_strdup("sudo");
/* wait for the child process to end or become something other
- then sudo */
- while ((!waitpid (pid, &status, WNOHANG)) &&
+ than sudo */
+ pid_t pid_exited;
+ while ((!(pid_exited = waitpid (pid, &status, WNOHANG))) &&
(g_str_has_suffix(cmdline, "sudo")))
{
if (cmdline)
@@ -2700,7 +2702,8 @@
bzero(buffer, 256);
}
- if (!WIFEXITED(status))
+ /* if the process is still active waitpid() on it */
+ if (pid_exited != pid)
waitpid(pid, &status, 0);
sudo_reset_xauth (context, xauth, xauth_env);
More information about the gksu-commits
mailing list