1
diff -Nur libgksu-2.0.5/libgksu/libgksu.c libgksu-2.0.5.new/libgksu/libgksu.c
2
--- libgksu-2.0.5/libgksu/libgksu.c 2007-06-22 12:48:13.000000000 +0200
3
+++ libgksu-2.0.5.new/libgksu/libgksu.c 2007-06-22 12:48:33.000000000 +0200
5
cmdline = g_strdup("bin/su");
6
/* wait for the child process to end or become something other
8
- while ((!waitpid (pid, &status, WNOHANG)) &&
10
+ while ((!(pid_exited = waitpid (pid, &status, WNOHANG))) &&
11
(g_str_has_suffix(cmdline, "bin/su")))
18
- if (!WIFEXITED(status))
19
+ if (pid_exited != pid)
20
waitpid(pid, &status, 0);
22
if (WEXITSTATUS(status))
24
cmdline = g_strdup("sudo");
25
/* wait for the child process to end or become something other
27
- while ((!waitpid (pid, &status, WNOHANG)) &&
29
+ while ((!(pid_exited = waitpid (pid, &status, WNOHANG))) &&
30
(g_str_has_suffix(cmdline, "sudo")))
37
- if (!WIFEXITED(status))
38
+ // if the process is still active waitpid() on it
39
+ if (pid_exited != pid)
40
waitpid(pid, &status, 0);
41
sudo_reset_xauth (context, xauth, xauth_env);