Follow-up to a2f4b35, remove username arg from service_register()

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-10-15 20:32:11 +02:00
parent cf60cdd9c9
commit 7d9f873b7c
3 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -315,26 +315,26 @@ static void parse_dynamic(char *line, struct timeval *mtime)
/* Monitored daemon, will be respawned on exit */ /* Monitored daemon, will be respawned on exit */
if (MATCH_CMD(line, "service ", x)) { if (MATCH_CMD(line, "service ", x)) {
service_register(SVC_TYPE_SERVICE, x, mtime, NULL); service_register(SVC_TYPE_SERVICE, x, mtime);
return; return;
} }
/* One-shot task, will not be respawned */ /* One-shot task, will not be respawned */
if (MATCH_CMD(line, "task ", x)) { if (MATCH_CMD(line, "task ", x)) {
service_register(SVC_TYPE_TASK, x, mtime, NULL); service_register(SVC_TYPE_TASK, x, mtime);
return; return;
} }
/* Like task but waits for completion, useful w/ [S] */ /* Like task but waits for completion, useful w/ [S] */
if (MATCH_CMD(line, "run ", x)) { if (MATCH_CMD(line, "run ", x)) {
service_register(SVC_TYPE_RUN, x, mtime, NULL); service_register(SVC_TYPE_RUN, x, mtime);
return; return;
} }
/* Classic inetd service */ /* Classic inetd service */
if (MATCH_CMD(line, "inetd ", x)) { if (MATCH_CMD(line, "inetd ", x)) {
#ifdef INETD_ENABLED #ifdef INETD_ENABLED
service_register(SVC_TYPE_INETD, x, mtime, NULL); service_register(SVC_TYPE_INETD, x, mtime);
#else #else
_e("Finit built with inetd support disabled, cannot register service inetd %s!", x); _e("Finit built with inetd support disabled, cannot register service inetd %s!", x);
#endif #endif
+2 -2
View File
@@ -458,7 +458,6 @@ void service_runlevel(int newlevel)
* @type: %SVC_TYPE_SERVICE(0), %SVC_TYPE_TASK(1), %SVC_TYPE_RUN(2) * @type: %SVC_TYPE_SERVICE(0), %SVC_TYPE_TASK(1), %SVC_TYPE_RUN(2)
* @line: A complete command line with -- separated description text * @line: A complete command line with -- separated description text
* @mtime: The modification time if service is loaded from /etc/finit.d * @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 * This function is used to register commands to be run on different
* system runlevels with optional username. The @type argument details * system runlevels with optional username. The @type argument details
@@ -505,7 +504,7 @@ void service_runlevel(int newlevel)
* Returns: * Returns:
* POSIX OK(0) on success, or non-zero errno exit status on failure. * 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 i = 0;
int id = 1; /* Default to ID:1 */ 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; int forking = 0;
#endif #endif
int log = 0, levels = 0; int log = 0, levels = 0;
char *username;
char *service = NULL, *proto = NULL, *ifaces = NULL; char *service = NULL, *proto = NULL, *ifaces = NULL;
char *cmd, *desc, *runlevels = NULL, *cond = NULL; char *cmd, *desc, *runlevels = NULL, *cond = NULL;
svc_t *svc; svc_t *svc;
+1 -1
View File
@@ -28,7 +28,7 @@
#include "svc.h" #include "svc.h"
void service_runlevel (int newlevel); 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); void service_unregister (svc_t *svc);
int service_enabled (svc_t *svc); int service_enabled (svc_t *svc);