chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
201e673
)
socket: when going down, flush all queued sockets
author
Lennart Poettering
<lennart@poettering.net>
Mon, 12 Jul 2010 22:51:48 +0000
(
00:51
+0200)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 12 Jul 2010 22:52:17 +0000
(
00:52
+0200)
src/socket.c
patch
|
blob
|
history
diff --git
a/src/socket.c
b/src/socket.c
index f998cada26b0e4c3f4cfd50d54cffd8ac64edaa3..4a9c939936ee843f0164988935f985cf1b1f7fe4 100644
(file)
--- a/
src/socket.c
+++ b/
src/socket.c
@@
-1033,7
+1033,18
@@
static void socket_enter_running(Socket *s, int cfd) {
/* We don't take connections anymore if we are supposed to
* shut down anyway */
if (s->meta.job && s->meta.job->type == JOB_STOP) {
- close_nointr_nofail(cfd);
+ if (cfd >= 0)
+ close_nointr_nofail(cfd);
+ else {
+ /* Flush all sockets by closing and reopening them */
+ socket_close_fds(s);
+
+ if ((r = socket_watch_fds(s)) < 0) {
+ log_warning("%s failed to watch sockets: %s", s->meta.id, strerror(-r));
+ socket_enter_stop_pre(s, false);
+ }
+ }
+
return;
}