~xnox/upstart/reboot-fix

« back to all changes in this revision

Viewing changes to init/control.h

  • Committer: Dimitri John Ledkov
  • Date: 2014-03-05 13:26:05 UTC
  • mfrom: (1572.4.2 upstart-fix-job_find)
  • Revision ID: dimitri.ledkov@canonical.com-20140305132605-zvbgw28thfret0c0
merge lp:~jamesodhunt/upstart/fix-job_find

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* upstart
2
2
 *
3
 
 * Copyright  2009-2011 Canonical Ltd.
 
3
 * Copyright © 2009-2011 Canonical Ltd.
4
4
 * Author: Scott James Remnant <scott@netsplit.com>.
5
5
 *
6
6
 * This program is free software; you can redistribute it and/or modify
60
60
 **/
61
61
#define control_get_job(session, job, job_name, instance)             \
62
62
{                                                                     \
63
 
        if (job_name != NULL ) {                                      \
 
63
        if (job_name) {                                               \
64
64
                JobClass *class;                                      \
65
65
                                                                      \
66
66
                class = job_class_get_registered (job_name, session); \
73
73
                        return -1;                                    \
74
74
                }                                                     \
75
75
                                                                      \
76
 
                job = job_find (session, class, NULL, instance);      \
77
 
                if (job == NULL) {                                    \
 
76
                job = job_find (session, class, job_name, instance);  \
 
77
                if (! job) {                                          \
78
78
                        nih_dbus_error_raise_printf (                 \
79
79
                                DBUS_INTERFACE_UPSTART                \
80
80
                                ".Error.UnknownJobInstance",          \
81
81
                                _("Unknown instance: %s of job %s"),  \
82
 
                                instance, job_name);                  \
 
82
                                instance ? instance : "(null)",       \
 
83
                                job_name);                            \
83
84
                        return -1;                                    \
84
85
                }                                                     \
85
86
        }                                                             \