Build fixes for configure --disable-inetd

service.c:
	Don't declare find_inetd_svc() if inetd is disabled.
api.c:
	Disable inetd API
initctl.c:
	Disable presentation of inetd services

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2015-10-22 18:59:20 +02:00
1 parent 58980c72fa
commit 8725200260
3 files changed
+17 -8

No files matched your search

+5
View File
@@ -30,6 +30,7 @@
#include <sys/socket.h>
#include <sys/un.h>
#include "config.h"
#include "finit.h"
#include "conf.h"
#include "helpers.h"
@@ -112,6 +113,7 @@ static int do_stop (char *buf, size_t len) { return call(service_stop, buf,
static int do_reload (char *buf, size_t len) { return call(service_reload, buf, len); }
static int do_restart(char *buf, size_t len) { return call(service_restart, buf, len); }
#ifndef INETD_DISABLED
static int do_query_inetd(char *buf, size_t len)
{
int id = 1;
@@ -135,6 +137,7 @@ static int do_query_inetd(char *buf, size_t len)
return inetd_filter_str(&svc->inetd, buf, len);
}
#endif /* !INETD_DISABLED */
typedef struct {
char *event;
@@ -275,9 +278,11 @@ static void cb(uev_t *w, void *UNUSED(arg), int UNUSED(events))
result = do_restart(rq.data, sizeof(rq.data));
break;
#ifndef INETD_DISABLED
case INIT_CMD_QUERY_INETD:
result = do_query_inetd(rq.data, sizeof(rq.data));
break;
#endif
case INIT_CMD_EMIT:
result = do_handle_emit(rq.data, sizeof(rq.data));
+10 -7
View File
@@ -149,12 +149,7 @@ static int show_status(char *UNUSED(arg))
}
for (svc = svc_iterator(1); svc; svc = svc_iterator(0)) {
int inetd = svc_is_inetd(svc);
char jobid[10], args[512] = "";
struct init_request rq = {
.magic = INIT_MAGIC,
.cmd = INIT_CMD_QUERY_INETD,
};
if (svc_is_unique(svc))
snprintf(jobid, sizeof(jobid), "%d", svc->job);
@@ -167,8 +162,13 @@ static int show_status(char *UNUSED(arg))
continue;
}
if (inetd) {
#ifndef INETD_DISABLED
if (svc_is_inetd(svc)) {
char *info;
struct init_request rq = {
.magic = INIT_MAGIC,
.cmd = INIT_CMD_QUERY_INETD,
};
snprintf(rq.data, sizeof(rq.data), "%s", jobid);
if (do_send(&rq, sizeof(rq))) {
@@ -184,7 +184,10 @@ static int show_status(char *UNUSED(arg))
}
printf("%s %s\n", svc->cmd, info);
} else {
}
else
#endif /* !INETD_DISABLED */
{
int i;
for (i = 1; i < MAX_NUM_SVC_ARGS; i++) {
+2 -1
View File
@@ -44,8 +44,9 @@
static int is_norespawn (void);
static void restart_lost_procs (void);
static void svc_dance (svc_t *svc);
#ifndef INETD_DISABLED
static svc_t *find_inetd_svc (char *path, char *service, char *proto);
#endif
/**
* service_bootstrap - Start bootstrap services and tasks