rpms/system-config-printer/F-9 system-config-printer-exit-code.patch, NONE, 1.1 system-config-printer.spec, 1.183, 1.184
Tim Waugh (twaugh)
fedora-extras-commits at redhat.com
Mon May 12 16:24:29 UTC 2008
Author: twaugh
Update of /cvs/pkgs/rpms/system-config-printer/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20061
Modified Files:
system-config-printer.spec
Added Files:
system-config-printer-exit-code.patch
Log Message:
* Mon May 12 2008 Tim Waugh <twaugh at redhat.com> 0.7.82.3-2
- Avoid zombie processes in the applet (bug #446055).
system-config-printer-exit-code.patch:
--- NEW FILE system-config-printer-exit-code.patch ---
diff -U0 system-config-printer-0.7.82.3/ChangeLog.exit-code system-config-printer-0.7.82.3/ChangeLog
--- system-config-printer-0.7.82.3/ChangeLog.exit-code 2008-05-12 17:22:44.000000000 +0100
+++ system-config-printer-0.7.82.3/ChangeLog 2008-05-12 17:22:57.000000000 +0100
@@ -2,0 +3,3 @@
+ * applet.py (NewPrinterNotification.collect_exit_code): New
+ method. Collect exit code of child (bug #446055).
+
diff -up system-config-printer-0.7.82.3/applet.py.exit-code system-config-printer-0.7.82.3/applet.py
--- system-config-printer-0.7.82.3/applet.py.exit-code 2008-05-09 15:00:37.000000000 +0100
+++ system-config-printer-0.7.82.3/applet.py 2008-05-12 17:22:57.000000000 +0100
@@ -1251,6 +1251,8 @@ class NewPrinterNotification(dbus.servic
sys.exit (1)
elif pid == -1:
print "Error forking process"
+ else:
+ gobject.timeout_add (60 * 1000, self.collect_exit_code, pid)
def configure (self, notification, action, name):
self.run_config_tool (["--configure-printer", name])
@@ -1269,6 +1271,24 @@ class NewPrinterNotification(dbus.servic
sys.exit (1)
elif pid == -1:
print "Error forking process"
+ else:
+ gobject.timeout_add (60 * 1000, self.collect_exit_code, pid)
+
+ def collect_exit_code (self, pid):
+ # We do this with timers instead of signals because we already
+ # have gobject imported, but don't (yet) import signal;
+ # let's try not to inflate the process size.
+ import os
+ try:
+ print "Waiting for child %d" % pid
+ (pid, status) = os.waitpid (pid, os.WNOHANG)
+ if pid == 0:
+ # Run this timer again.
+ return True
+ except OSError:
+ pass
+
+ return False
try:
bus = dbus.SystemBus()
Index: system-config-printer.spec
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-printer/F-9/system-config-printer.spec,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -r1.183 -r1.184
--- system-config-printer.spec 12 May 2008 16:15:42 -0000 1.183
+++ system-config-printer.spec 12 May 2008 16:23:49 -0000 1.184
@@ -12,6 +12,7 @@
Source0: system-config-printer-%{version}.tar.bz2
Source1: pycups-%{pycups_version}.tar.bz2
Patch1: system-config-printer-dash.patch
+Patch2: system-config-printer-exit-code.patch
BuildRequires: cups-devel >= 1.2
BuildRequires: python-devel >= 2.4
@@ -56,6 +57,7 @@
%prep
%setup -q -a 1
%patch1 -p1 -b .dash
+%patch2 -p1 -b .exit-code
%build
%configure
@@ -123,6 +125,7 @@
%changelog
* Mon May 12 2008 Tim Waugh <twaugh at redhat.com> 0.7.82.3-2
+- Avoid zombie processes in the applet (bug #446055).
- Use dash instead of underscore when replacing disallowed characters in
queue names (bug #445790).
More information about the scm-commits
mailing list