chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
execute: if the main process of a service already owns the TTY, don't wait for acquir...
[elogind.git]
/
src
/
socket.c
diff --git
a/src/socket.c
b/src/socket.c
index 03e556c30e18012cb53cb15a8cdf1e5df7b2b78c..ee75de04d647b09210e50f71cc6f86d2a57d5caf 100644
(file)
--- a/
src/socket.c
+++ b/
src/socket.c
@@
-38,6
+38,7
@@
#include "dbus-socket.h"
#include "missing.h"
#include "special.h"
#include "dbus-socket.h"
#include "missing.h"
#include "special.h"
+#include "bus-errors.h"
static const UnitActiveState state_translation_table[_SOCKET_STATE_MAX] = {
[SOCKET_DEAD] = UNIT_INACTIVE,
static const UnitActiveState state_translation_table[_SOCKET_STATE_MAX] = {
[SOCKET_DEAD] = UNIT_INACTIVE,
@@
-821,6
+822,7
@@
static int socket_spawn(Socket *s, ExecCommand *c, pid_t *_pid) {
s->meta.manager->environment,
true,
true,
s->meta.manager->environment,
true,
true,
+ true,
s->meta.manager->confirm_spawn,
s->meta.cgroup_bondings,
&pid);
s->meta.manager->confirm_spawn,
s->meta.cgroup_bondings,
&pid);
@@
-1025,11
+1027,13
@@
fail:
static void socket_enter_running(Socket *s, int cfd) {
int r;
static void socket_enter_running(Socket *s, int cfd) {
int r;
+ DBusError error;
assert(s);
assert(s);
+ dbus_error_init(&error);
if (cfd < 0) {
if (cfd < 0) {
- if ((r = manager_add_job(s->meta.manager, JOB_START, UNIT(s->service), JOB_REPLACE, true, NULL)) < 0)
+ if ((r = manager_add_job(s->meta.manager, JOB_START, UNIT(s->service), JOB_REPLACE, true,
&error,
NULL)) < 0)
goto fail;
socket_set_state(s, SOCKET_RUNNING);
goto fail;
socket_set_state(s, SOCKET_RUNNING);
@@
-1061,7
+1065,7
@@
static void socket_enter_running(Socket *s, int cfd) {
goto fail;
}
goto fail;
}
- r = manager_load_unit(s->meta.manager, name, NULL, &u);
+ r = manager_load_unit(s->meta.manager, name, NULL,
NULL,
&u);
free(name);
if (r < 0)
free(name);
if (r < 0)
@@
-1074,18
+1078,20
@@
static void socket_enter_running(Socket *s, int cfd) {
s->n_connections ++;
s->n_connections ++;
- if ((r = manager_add_job(u->meta.manager, JOB_START, u, JOB_REPLACE, true, NULL)) < 0)
+ if ((r = manager_add_job(u->meta.manager, JOB_START, u, JOB_REPLACE, true,
&error,
NULL)) < 0)
goto fail;
}
return;
fail:
goto fail;
}
return;
fail:
- log_warning("%s failed to queue socket startup job: %s", s->meta.id,
strerror(-
r));
+ log_warning("%s failed to queue socket startup job: %s", s->meta.id,
bus_error(&error,
r));
socket_enter_stop_pre(s, false);
if (cfd >= 0)
close_nointr_nofail(cfd);
socket_enter_stop_pre(s, false);
if (cfd >= 0)
close_nointr_nofail(cfd);
+
+ dbus_error_free(&error);
}
static void socket_run_next(Socket *s, bool success) {
}
static void socket_run_next(Socket *s, bool success) {
@@
-1397,7
+1403,7
@@
static void socket_sigchld_event(Unit *u, pid_t pid, int code, int status) {
s->failure = s->failure || !success;
if (s->control_command)
s->failure = s->failure || !success;
if (s->control_command)
- exec_status_
fill
(&s->control_command->exec_status, pid, code, status);
+ exec_status_
exit
(&s->control_command->exec_status, pid, code, status);
log_debug("%s control process exited, code=%s status=%i", u->meta.id, sigchld_code_to_string(code), status);
log_debug("%s control process exited, code=%s status=%i", u->meta.id, sigchld_code_to_string(code), status);