summaryrefslogtreecommitdiff
path: root/src/activate/activate.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-07 16:52:47 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-07 16:53:26 +0100
commit2c408cb6276e3b8d18fb4e2a81a1128d8bbaa70d (patch)
treee18c855b5a3cfb834761876d9eff911e8a98976e /src/activate/activate.c
parent2cd33d82b6b4dd3eec3ccf6b8da36f3f3312ff32 (diff)
activate: print a nice message if no fd to listen on was specified
Diffstat (limited to 'src/activate/activate.c')
-rw-r--r--src/activate/activate.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/activate/activate.c b/src/activate/activate.c
index f0944aac5c..3198f7de98 100644
--- a/src/activate/activate.c
+++ b/src/activate/activate.c
@@ -127,7 +127,7 @@ static int open_sockets(int *epoll_fd, bool accept) {
_cleanup_free_ char *name = NULL;
getsockname_pretty(fd, &name);
- log_info("Listening on %s.", strna(name));
+ log_info("Listening on %s as %i.", strna(name), fd);
r = add_epoll(*epoll_fd, fd);
if (r < 0)
@@ -381,6 +381,10 @@ int main(int argc, char **argv, char **envp) {
n = open_sockets(&epoll_fd, arg_accept);
if (n < 0)
return EXIT_FAILURE;
+ if (n == 0) {
+ log_error("No sockets to listen on specified or passed in.");
+ return EXIT_FAILURE;
+ }
for (;;) {
struct epoll_event event;
@@ -394,7 +398,7 @@ int main(int argc, char **argv, char **envp) {
return EXIT_FAILURE;
}
- log_info("Communication attempt on fd:%d", event.data.fd);
+ log_info("Communication attempt on fd %i.", event.data.fd);
if (arg_accept) {
r = do_accept(argv[optind], argv + optind, envp,
event.data.fd);