chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
logind: support for hybrid sleep (i.e. suspend+hibernate at the same time)
[elogind.git]
/
src
/
core
/
socket.c
diff --git
a/src/core/socket.c
b/src/core/socket.c
index cbbfb0cd3a033436a7215ec36fa72300a78ffa01..71cdf2dfc83acb8821434602609d5349dc258128 100644
(file)
--- a/
src/core/socket.c
+++ b/
src/core/socket.c
@@
-39,6
+39,7
@@
#include "mkdir.h"
#include "path-util.h"
#include "unit-name.h"
#include "mkdir.h"
#include "path-util.h"
#include "unit-name.h"
+#include "unit-printf.h"
#include "dbus-socket.h"
#include "missing.h"
#include "special.h"
#include "dbus-socket.h"
#include "missing.h"
#include "special.h"
@@
-264,7
+265,8
@@
int socket_add_one_mount_link(Socket *s, Mount *m) {
if (!socket_needs_mount(s, m->where))
return 0;
if (!socket_needs_mount(s, m->where))
return 0;
- if ((r = unit_add_two_dependencies(UNIT(s), UNIT_AFTER, UNIT_REQUIRES, UNIT(m), true)) < 0)
+ r = unit_add_two_dependencies(UNIT(s), UNIT_AFTER, UNIT_REQUIRES, UNIT(m), true);
+ if (r < 0)
return r;
return 0;
return r;
return 0;
@@
-276,9
+278,11
@@
static int socket_add_mount_links(Socket *s) {
assert(s);
assert(s);
- LIST_FOREACH(units_by_type, other, UNIT(s)->manager->units_by_type[UNIT_MOUNT])
- if ((r = socket_add_one_mount_link(s, MOUNT(other))) < 0)
+ LIST_FOREACH(units_by_type, other, UNIT(s)->manager->units_by_type[UNIT_MOUNT]) {
+ r = socket_add_one_mount_link(s, MOUNT(other));
+ if (r < 0)
return r;
return r;
+ }
return 0;
}
return 0;
}
@@
-305,7
+309,7
@@
static int socket_add_default_dependencies(Socket *s) {
int r;
assert(s);
int r;
assert(s);
- if (UNIT(s)->manager->running_as ==
MANAGER
_SYSTEM) {
+ if (UNIT(s)->manager->running_as ==
SYSTEMD
_SYSTEM) {
if ((r = unit_add_dependency_by_name(UNIT(s), UNIT_BEFORE, SPECIAL_SOCKETS_TARGET, NULL, true)) < 0)
return r;
if ((r = unit_add_dependency_by_name(UNIT(s), UNIT_BEFORE, SPECIAL_SOCKETS_TARGET, NULL, true)) < 0)
return r;
@@
-584,7
+588,7
@@
static int instance_from_socket(int fd, unsigned nr, char **instance) {
}
case AF_INET6: {
}
case AF_INET6: {
- static const char ipv4_prefix[] = {
+ static const
unsigned
char ipv4_prefix[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF
};
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF
};
@@
-1850,7
+1854,8
@@
static void socket_fd_event(Unit *u, int fd, uint32_t events, Watch *w) {
if (w->socket_accept) {
for (;;) {
if (w->socket_accept) {
for (;;) {
- if ((cfd = accept4(fd, NULL, NULL, SOCK_NONBLOCK)) < 0) {
+ cfd = accept4(fd, NULL, NULL, SOCK_NONBLOCK);
+ if (cfd < 0) {
if (errno == EINTR)
continue;
if (errno == EINTR)
continue;
@@
-2194,6
+2199,8
@@
DEFINE_STRING_TABLE_LOOKUP(socket_result, SocketResult);
const UnitVTable socket_vtable = {
.object_size = sizeof(Socket),
const UnitVTable socket_vtable = {
.object_size = sizeof(Socket),
+ .exec_context_offset = offsetof(Socket, exec_context),
+
.sections =
"Unit\0"
"Socket\0"
.sections =
"Unit\0"
"Socket\0"