Merge lp:~vorlon/upstart/debian-bug-659540 into lp:upstart

Proposed by Steve Langasek
Status: Merged
Merged at revision: 1379
Proposed branch: lp:~vorlon/upstart/debian-bug-659540
Merge into: lp:upstart
Diff against target: 34 lines (+14/-2)
1 file modified
util/shutdown.c (+14/-2)
To merge this branch: bzr merge lp:~vorlon/upstart/debian-bug-659540
Reviewer Review Type Date Requested Status
James Hunt Approve
Review via email: mp+122349@code.launchpad.net

Description of the change

Self-explanatory fix for compatibilty with the new initctl path used by
sysvinit in Debian wheezy.

To post a comment you must log in.
Revision history for this message
James Hunt (jamesodhunt) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'util/shutdown.c'
--- util/shutdown.c 2010-12-20 09:46:30 +0000
+++ util/shutdown.c 2012-08-31 19:46:19 +0000
@@ -80,6 +80,14 @@
80#define DEV_INITCTL "/dev/initctl"80#define DEV_INITCTL "/dev/initctl"
81#endif81#endif
8282
83/**
84 * RUN_INITCTL:
85 *
86 * System V init control socket (new location).
87 **/
88#ifndef RUN_INITCTL
89#define RUN_INITCTL "/run/initctl"
90#endif
8391
84/* Prototypes for option functions */92/* Prototypes for option functions */
85static int runlevel_option (NihOption *option, const char *arg);93static int runlevel_option (NihOption *option, const char *arg);
@@ -819,9 +827,13 @@
819 sigemptyset (&act.sa_mask);827 sigemptyset (&act.sa_mask);
820 sigaction (SIGALRM, &act, NULL);828 sigaction (SIGALRM, &act, NULL);
821829
822 /* Try and open /dev/initctl */
823 alarm (3);830 alarm (3);
824 fd = open (DEV_INITCTL, O_WRONLY | O_NDELAY | O_NOCTTY);831 /* Try and open /run/initctl */
832 fd = open (RUN_INITCTL, O_WRONLY | O_NDELAY | O_NOCTTY);
833 if (fd < 0) {
834 /* Fall back to /dev/initctl */
835 fd = open (DEV_INITCTL, O_WRONLY | O_NDELAY | O_NOCTTY);
836 }
825 if (fd >= 0) {837 if (fd >= 0) {
826 if (write (fd, &request, sizeof (request)) == sizeof (request))838 if (write (fd, &request, sizeof (request)) == sizeof (request))
827 exit (0);839 exit (0);

Subscribers

People subscribed via source and target branches