From c3d27b0ac659776f4065bc04b94f12c6b7e40084 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Mon, 27 Mar 2017 15:54:44 +0200 Subject: [PATCH] Remove option readyfd MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This option is no more useful. Instead it is possible to use systemd notify feature. Change-Id: I8dd286242d3dc74238ca0908e83072367874d19e Signed-off-by: José Bollo --- src/afb-config.c | 7 ------- src/afb-config.h | 1 - src/main.c | 7 ------- 3 files changed, 15 deletions(-) diff --git a/src/afb-config.c b/src/afb-config.c index 7852f6c4..b06f01db 100644 --- a/src/afb-config.c +++ b/src/afb-config.c @@ -71,7 +71,6 @@ #define SET_MODE 18 -#define SET_READYFD 19 #define DBUS_CLIENT 20 #define DBUS_SERVICE 21 @@ -141,7 +140,6 @@ static AFB_options cliOptions[] = { {DISPLAY_HELP, 0, "help", "Display this help"}, {SET_MODE, 1, "mode", "Set the mode: either local, remote or global"}, - {SET_READYFD, 1, "readyfd", "Set the #fd to signal when ready"}, {DBUS_CLIENT, 1, "dbus-client", "Bind to an afb service through dbus"}, {DBUS_SERVICE, 1, "dbus-server", "Provides an afb service through dbus"}, @@ -464,10 +462,6 @@ static void parse_arguments(int argc, char **argv, struct afb_config *config) config->mode = argvalenum(optc, mode_desc); break; - case SET_READYFD: - config->readyfd = argvalintdec(optc, 0, INT_MAX); - break; - case DBUS_CLIENT: list_add(&config->dbus_clients, argvalstr(optc)); break; @@ -617,7 +611,6 @@ void afb_config_dump(struct afb_config *config) D(httpdPort) B(background) - D(readyfd) D(cacheTimeout) D(apiTimeout) D(cntxTimeout) diff --git a/src/afb-config.h b/src/afb-config.h index 43b550db..09be2165 100644 --- a/src/afb-config.h +++ b/src/afb-config.h @@ -48,7 +48,6 @@ struct afb_config { int httpdPort; int background; // run in backround mode - int readyfd; // a #fd to signal when ready to serve int cacheTimeout; int apiTimeout; int cntxTimeout; // Client Session Context timeout diff --git a/src/main.c b/src/main.c index 39296742..d31f1f52 100644 --- a/src/main.c +++ b/src/main.c @@ -495,13 +495,6 @@ int main(int argc, char *argv[]) if (execute_command() < 0) exit(1); - /* signal that ready */ - if (config->readyfd != 0) { - static const char readystr[] = "READY=1"; - write(config->readyfd, readystr, sizeof(readystr) - 1); - close(config->readyfd); - } - // infinite loop eventloop = afb_common_get_event_loop(); sd_notify(1, "READY=1"); -- 2.16.6