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 | |
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.
-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 | |||
@@ -334,7 +334,7 @@ tcpmux (int fd, struct component const *comp) | |||
334 | 334 | ||
335 | if (!strcasecmp (service, "help")) | 335 | if (!strcasecmp (service, "help")) |
336 | { | 336 | { |
337 | progman_iterate_comp (tcpmux_help, &fd); | 337 | component_foreach (tcpmux_help, &fd); |
338 | return; | 338 | return; |
339 | } | 339 | } |
340 | 340 | ||
@@ -349,9 +349,6 @@ struct component *progman_lookup_tcpmux (const char *service, | |||
349 | void progman_run_comp (struct component *comp, int fd, | 349 | void progman_run_comp (struct component *comp, int fd, |
350 | union pies_sockaddr_storage *sa, socklen_t salen); | 350 | union pies_sockaddr_storage *sa, socklen_t salen); |
351 | 351 | ||
352 | void progman_iterate_comp (int (*fun) (struct component *, void *), | ||
353 | void *data); | ||
354 | |||
355 | void fd_report (int fd, const char *msg); | 352 | void fd_report (int fd, const char *msg); |
356 | 353 | ||
357 | int check_acl (pies_acl_t acl, struct sockaddr *s, socklen_t salen, | 354 | int check_acl (pies_acl_t acl, struct sockaddr *s, socklen_t salen, |
@@ -572,7 +569,8 @@ extern char *init_fifo; | |||
572 | 569 | ||
573 | #define INIT_CMD_CHANGECONS 12345 | 570 | #define INIT_CMD_CHANGECONS 12345 |
574 | 571 | ||
575 | struct sysvinit_request { | 572 | struct sysvinit_request |
573 | { | ||
576 | int magic; /* Magic number */ | 574 | int magic; /* Magic number */ |
577 | int cmd; /* What kind of request */ | 575 | int cmd; /* What kind of request */ |
578 | int runlevel; /* Runlevel to change to */ | 576 | int runlevel; /* Runlevel to change to */ |
diff --git a/src/progman.c b/src/progman.c index 1a5bc90..f68fe91 100644 --- a/src/progman.c +++ b/src/progman.c | |||
@@ -46,20 +46,6 @@ progman_foreach (int (*filter) (struct prog *, void *data), void *data) | |||
46 | } | 46 | } |
47 | return rc; | 47 | return rc; |
48 | } | 48 | } |
49 | |||
50 | /* FIXME: Rewrite this using progman_foreach? */ | ||
51 | void | ||
52 | progman_iterate_comp (int (*fun) (struct component *, void *), void *data) | ||
53 | { | ||
54 | struct prog *prog; | ||
55 | |||
56 | for (prog = proghead; prog; prog = prog->next) | ||
57 | if (IS_COMPONENT (prog) | ||
58 | && !(prog->v.p.comp->mode == pies_comp_inetd | ||
59 | && prog->v.p.listener) | ||
60 | && fun (prog->v.p.comp, data)) | ||
61 | break; | ||
62 | } | ||
63 | 49 | ||
64 | static struct prog * | 50 | static struct prog * |
65 | prog_lookup_by_pid (pid_t pid) | 51 | prog_lookup_by_pid (pid_t pid) |