diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-02-22 12:38:10 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-02-22 12:42:47 +0200 |
commit | 584266f8215d913ce0c226f63da51c77d1074f09 (patch) | |
tree | ba4a83527b5d18385ad7c17d2be24c7a04e4e2ce /src | |
parent | bfa3617a79292e3569587c65cd218b69bdfd28a2 (diff) | |
download | pies-584266f8215d913ce0c226f63da51c77d1074f09.tar.gz pies-584266f8215d913ce0c226f63da51c77d1074f09.tar.bz2 |
Get rid of progman_iterate_comp
* src/inetd-bi.c (tcpmux): Use component_foreach to
handle help requests.
* src/progman.c (progman_iterate_comp): Removed.
* src/pies.h: Likewise.
Diffstat (limited to 'src')
-rw-r--r-- | src/inetd-bi.c | 2 | ||||
-rw-r--r-- | src/pies.h | 6 | ||||
-rw-r--r-- | src/progman.c | 14 |
3 files changed, 3 insertions, 19 deletions
diff --git a/src/inetd-bi.c b/src/inetd-bi.c index d0d3ea4..7ce4b39 100644 --- a/src/inetd-bi.c +++ b/src/inetd-bi.c @@ -331,13 +331,13 @@ tcpmux (int fd, struct component const *comp) service[len] = 0; debug (2, ("tcpmux: someone wants %s", service)); if (!strcasecmp (service, "help")) { - progman_iterate_comp (tcpmux_help, &fd); + component_foreach (tcpmux_help, &fd); return; } srv_comp = progman_lookup_tcpmux (service, comp->tag); if (!srv_comp) { @@ -346,15 +346,12 @@ struct component *progman_lookup_component (const char *tag); struct component *progman_lookup_tcpmux (const char *service, const char *master); void progman_run_comp (struct component *comp, int fd, union pies_sockaddr_storage *sa, socklen_t salen); -void progman_iterate_comp (int (*fun) (struct component *, void *), - void *data); - void fd_report (int fd, const char *msg); int check_acl (pies_acl_t acl, struct sockaddr *s, socklen_t salen, pies_identity_t identity); void log_setup (int want_stderr); @@ -569,13 +566,14 @@ extern char *init_fifo; #define INIT_CMD_BSD 5 #define INIT_CMD_SETENV 6 #define INIT_CMD_UNSETENV 7 #define INIT_CMD_CHANGECONS 12345 -struct sysvinit_request { +struct sysvinit_request +{ int magic; /* Magic number */ int cmd; /* What kind of request */ int runlevel; /* Runlevel to change to */ int sleeptime; /* Time between TERM and KILL */ char data[368]; }; diff --git a/src/progman.c b/src/progman.c index 1a5bc90..f68fe91 100644 --- a/src/progman.c +++ b/src/progman.c @@ -43,26 +43,12 @@ progman_foreach (int (*filter) (struct prog *, void *data), void *data) if ((rc = filter (prog, data)) != 0) break; prog = next; } return rc; } - -/* FIXME: Rewrite this using progman_foreach? */ -void -progman_iterate_comp (int (*fun) (struct component *, void *), void *data) -{ - struct prog *prog; - - for (prog = proghead; prog; prog = prog->next) - if (IS_COMPONENT (prog) - && !(prog->v.p.comp->mode == pies_comp_inetd - && prog->v.p.listener) - && fun (prog->v.p.comp, data)) - break; -} static struct prog * prog_lookup_by_pid (pid_t pid) { struct prog *prog; |