Merge lp:~mvo/aptdaemon/use-glib-unix-signal-handling into lp:aptdaemon

Proposed by Michael Vogt on 2012-11-28
Status: Merged
Merged at revision: 875
Proposed branch: lp:~mvo/aptdaemon/use-glib-unix-signal-handling
Merge into: lp:aptdaemon
Diff against target: 25 lines (+6/-3)
1 file modified
aptdaemon/core.py (+6/-3)
To merge this branch: bzr merge lp:~mvo/aptdaemon/use-glib-unix-signal-handling
Reviewer Review Type Date Requested Status
Martin Pitt (community) 2012-11-28 Approve on 2012-11-28
Review via email: mp+136626@code.launchpad.net

Description of the Change

Use glib unix signal handling

To post a comment you must log in.
Martin Pitt (pitti) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'aptdaemon/core.py'
2--- aptdaemon/core.py 2012-11-26 10:29:31 +0000
3+++ aptdaemon/core.py 2012-11-28 11:26:21 +0000
4@@ -1395,8 +1395,11 @@
5 bus -- the D-Bus to connect to (defaults to the system bus)
6 """
7 log.info("Initializing daemon")
8- signal.signal(signal.SIGQUIT, self._sigquit)
9- signal.signal(signal.SIGTERM, self._sigquit)
10+ # glib does not support SIGQUIT
11+ #GLib.unix_signal_add_full(
12+ # GLib.PRIORITY_HIGH, signal.SIGQUIT, self._sigquit, None)
13+ GLib.unix_signal_add_full(
14+ GLib.PRIORITY_HIGH, signal.SIGTERM, self._sigquit, None)
15 # Decrease the priority of the daemon to avoid blocking UI
16 os.nice(5)
17 self.options = options
18@@ -2148,7 +2151,7 @@
19 else:
20 return {}
21
22- def _sigquit(self, signum, frame):
23+ def _sigquit(self, data):
24 """Internal callback for the quit signal."""
25 self.Quit(None)
26

Subscribers

People subscribed via source and target branches

to status/vote changes: