activate.c revision d31e430f14ea076665973b935003326e5ffcbfc8
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek This file is part of systemd.
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek Copyright 2013 Zbigniew Jędrzejewski-Szmek
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek systemd is free software; you can redistribute it and/or modify it
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek under the terms of the GNU Lesser General Public License as published by
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek the Free Software Foundation; either version 2.1 of the License, or
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek (at your option) any later version.
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek systemd is distributed in the hope that it will be useful, but
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek WITHOUT ANY WARRANTY; without even the implied warranty of
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek Lesser General Public License for more details.
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek You should have received a copy of the GNU Lesser General Public License
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek along with systemd; If not, see <http://www.gnu.org/licenses/>.
#include "macro.h"
#include "signal-util.h"
#include "socket-util.h"
#include "string-util.h"
#include "strv.h"
static bool arg_accept = false;
char **address;
int n, fd, r;
int count = 0;
n = sd_listen_fds(true);
count ++;
if (arg_listen) {
log_close();
if (fd < 0) {
log_open();
count ++;
if (arg_listen)
log_open();
if (*epoll_fd < 0)
return count;
if (!envp)
return log_oom();
k = strdup(*s);
return log_oom();
_cleanup_free_ char *p;
return log_oom();
return log_oom();
return log_oom();
n_env ++;
return log_oom();
if (arg_fdname) {
return log_oom();
free(e);
return log_oom();
free(e);
if (!tmp)
return log_oom();
if (!tmp)
return log_oom();
if (child_pid < 0)
if (child_pid == 0) {
(void) reset_all_signal_handlers();
(void) reset_signal_mask();
if (fd2 < 0) {
return fd2;
static int install_chld_handler(void) {
static void help(void) {
help();
case ARG_VERSION:
return version();
return log_oom();
return -EINVAL;
case ARG_SEQPACKET:
return -EINVAL;
arg_accept = true;
return log_oom();
case ARG_FDNAME:
return -EINVAL;
return -EINVAL;
return -EINVAL;
return -EINVAL;
log_open();
r = install_chld_handler();
return EXIT_FAILURE;
return EXIT_FAILURE;
return EXIT_FAILURE;
return EXIT_FAILURE;
if (arg_accept) {
return EXIT_FAILURE;
return EXIT_SUCCESS;