From 7d9f873b7cd1f3a33cb98788ca85ed71aa6e07ab Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 15 Oct 2017 20:32:11 +0200 Subject: [PATCH] Follow-up to a2f4b35, remove username arg from service_register() Signed-off-by: Joachim Nilsson --- src/conf.c | 8 ++++---- src/service.c | 4 ++-- src/service.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/conf.c b/src/conf.c index 0e5b9ea8..f82bb75b 100644 --- a/src/conf.c +++ b/src/conf.c @@ -315,26 +315,26 @@ static void parse_dynamic(char *line, struct timeval *mtime) /* Monitored daemon, will be respawned on exit */ if (MATCH_CMD(line, "service ", x)) { - service_register(SVC_TYPE_SERVICE, x, mtime, NULL); + service_register(SVC_TYPE_SERVICE, x, mtime); return; } /* One-shot task, will not be respawned */ if (MATCH_CMD(line, "task ", x)) { - service_register(SVC_TYPE_TASK, x, mtime, NULL); + service_register(SVC_TYPE_TASK, x, mtime); return; } /* Like task but waits for completion, useful w/ [S] */ if (MATCH_CMD(line, "run ", x)) { - service_register(SVC_TYPE_RUN, x, mtime, NULL); + service_register(SVC_TYPE_RUN, x, mtime); return; } /* Classic inetd service */ if (MATCH_CMD(line, "inetd ", x)) { #ifdef INETD_ENABLED - service_register(SVC_TYPE_INETD, x, mtime, NULL); + service_register(SVC_TYPE_INETD, x, mtime); #else _e("Finit built with inetd support disabled, cannot register service inetd %s!", x); #endif diff --git a/src/service.c b/src/service.c index b093a8a6..8b65ef57 100644 --- a/src/service.c +++ b/src/service.c @@ -458,7 +458,6 @@ void service_runlevel(int newlevel) * @type: %SVC_TYPE_SERVICE(0), %SVC_TYPE_TASK(1), %SVC_TYPE_RUN(2) * @line: A complete command line with -- separated description text * @mtime: The modification time if service is loaded from /etc/finit.d - * @username: Optional username to run service as, or %NULL to run as root * * This function is used to register commands to be run on different * system runlevels with optional username. The @type argument details @@ -505,7 +504,7 @@ void service_runlevel(int newlevel) * Returns: * POSIX OK(0) on success, or non-zero errno exit status on failure. */ -int service_register(int type, char *line, struct timeval *mtime, char *username) +int service_register(int type, char *line, struct timeval *mtime) { int i = 0; int id = 1; /* Default to ID:1 */ @@ -513,6 +512,7 @@ int service_register(int type, char *line, struct timeval *mtime, char *username int forking = 0; #endif int log = 0, levels = 0; + char *username; char *service = NULL, *proto = NULL, *ifaces = NULL; char *cmd, *desc, *runlevels = NULL, *cond = NULL; svc_t *svc; diff --git a/src/service.h b/src/service.h index 1f593b8f..51ba4fe5 100644 --- a/src/service.h +++ b/src/service.h @@ -28,7 +28,7 @@ #include "svc.h" void service_runlevel (int newlevel); -int service_register (int type, char *line, struct timeval *mtime, char *username); +int service_register (int type, char *line, struct timeval *mtime); void service_unregister (svc_t *svc); int service_enabled (svc_t *svc);