summaryrefslogtreecommitdiff
path: root/networking/inetd.c
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2004-01-17 01:26:53 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2004-01-17 01:26:53 +0000
commitc3b134f3b735bffd34a07efe9004627d0b29a287 (patch)
tree6d75f0f0962a031c075e989a5593ab1c2a7dec80 /networking/inetd.c
parent2faf306c732609a2fb32a196a1bade1b4f44aa12 (diff)
downloadbusybox-w32-c3b134f3b735bffd34a07efe9004627d0b29a287.tar.gz
busybox-w32-c3b134f3b735bffd34a07efe9004627d0b29a287.tar.bz2
busybox-w32-c3b134f3b735bffd34a07efe9004627d0b29a287.zip
Changed #define names for common features (superficial)
Diffstat (limited to 'networking/inetd.c')
-rw-r--r--networking/inetd.c53
1 files changed, 22 insertions, 31 deletions
diff --git a/networking/inetd.c b/networking/inetd.c
index 4e3c3431e..c594a67f2 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -155,23 +155,13 @@ static int rlim_ofile_cur = OPEN_MAX;
155static struct rlimit rlim_ofile; 155static struct rlimit rlim_ofile;
156#endif 156#endif
157 157
158#define INETD_UNSUPPORT_BILTIN 1
159
160/* Check unsupporting builtin */ 158/* Check unsupporting builtin */
161#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_ECHO 159#if defined CONFIG_FEATURE_INETD_SUPPORT_BILTIN_ECHO || \
162#undef INETD_UNSUPPORT_BILTIN 160 defined CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DISCARD || \
163#endif 161 defined CONFIG_FEATURE_INETD_SUPPORT_BILTIN_TIME || \
164#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DISCARD 162 defined CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME || \
165#undef INETD_UNSUPPORT_BILTIN 163 defined CONFIG_FEATURE_INETD_SUPPORT_BILTIN_CHARGEN
166#endif 164# define INETD_FEATURE_ENABLED
167#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_TIME
168#undef INETD_UNSUPPORT_BILTIN
169#endif
170#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME
171#undef INETD_UNSUPPORT_BILTIN
172#endif
173#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_CHARGEN
174#undef INETD_UNSUPPORT_BILTIN
175#endif 165#endif
176 166
177static struct servtab { 167static struct servtab {
@@ -183,7 +173,7 @@ static struct servtab {
183 short se_checked; /* looked at during merge */ 173 short se_checked; /* looked at during merge */
184 char *se_user; /* user name to run as */ 174 char *se_user; /* user name to run as */
185 char *se_group; /* group name to run as */ 175 char *se_group; /* group name to run as */
186#ifndef INETD_UNSUPPORT_BILTIN 176#ifdef INETD_FEATURE_ENABLED
187 const struct biltin *se_bi; /* if built-in, description */ 177 const struct biltin *se_bi; /* if built-in, description */
188#endif 178#endif
189 char *se_server; /* server program */ 179 char *se_server; /* server program */
@@ -240,7 +230,8 @@ static void chargen_stream(int, struct servtab *);
240static void chargen_dg(int, struct servtab *); 230static void chargen_dg(int, struct servtab *);
241#endif 231#endif
242 232
243#ifndef INETD_UNSUPPORT_BILTIN 233
234#ifdef INETD_FEATURE_ENABLED
244struct biltin { 235struct biltin {
245 const char *bi_service; /* internally provided service name */ 236 const char *bi_service; /* internally provided service name */
246 int bi_socktype; /* type of socket supported */ 237 int bi_socktype; /* type of socket supported */
@@ -277,7 +268,7 @@ static const struct biltin biltins[] = {
277#endif 268#endif
278 { NULL, 0, 0, 0, NULL } 269 { NULL, 0, 0, 0, NULL }
279}; 270};
280#endif /* INETD_UNSUPPORT_BILTIN */ 271#endif /* INETD_FEATURE_ENABLED */
281 272
282#define NUMINT (sizeof(intab) / sizeof(struct inent)) 273#define NUMINT (sizeof(intab) / sizeof(struct inent))
283static const char *CONFIG = _PATH_INETDCONF; 274static const char *CONFIG = _PATH_INETDCONF;
@@ -423,7 +414,7 @@ more:
423 } 414 }
424 sep->se_server = newstr(skip(&cp)); 415 sep->se_server = newstr(skip(&cp));
425 if (strcmp(sep->se_server, "internal") == 0) { 416 if (strcmp(sep->se_server, "internal") == 0) {
426#ifndef INETD_UNSUPPORT_BILTIN 417#ifdef INETD_FEATURE_ENABLED
427 const struct biltin *bi; 418 const struct biltin *bi;
428 419
429 for (bi = biltins; bi->bi_service; bi++) 420 for (bi = biltins; bi->bi_service; bi++)
@@ -443,8 +434,8 @@ more:
443 goto more; 434 goto more;
444#endif 435#endif
445 } else 436 } else
446#ifndef INETD_UNSUPPORT_BILTIN 437#ifdef INETD_FEATURE_ENABLED
447 sep->se_bi = NULL 438 sep->se_bi = NULL
448#endif 439#endif
449 ; 440 ;
450 argc = 0; 441 argc = 0;
@@ -471,7 +462,7 @@ freeconfig(struct servtab *cp)
471 free(cp->se_argv[i]); 462 free(cp->se_argv[i]);
472} 463}
473 464
474#ifndef INETD_UNSUPPORT_BILTIN 465#ifdef INETD_FEATURE_ENABLED
475static char **Argv; 466static char **Argv;
476static char *LastArg; 467static char *LastArg;
477 468
@@ -494,7 +485,7 @@ setproctitle(char *a, int s)
494 while (cp < LastArg) 485 while (cp < LastArg)
495 *cp++ = ' '; 486 *cp++ = ' ';
496} 487}
497#endif /* INETD_UNSUPPORT_BILTIN */ 488#endif /* INETD_FEATURE_ENABLED */
498 489
499static struct servtab * 490static struct servtab *
500enter(struct servtab *cp) 491enter(struct servtab *cp)
@@ -622,7 +613,7 @@ config(int signum)
622 * wait. 613 * wait.
623 */ 614 */
624 if ( 615 if (
625#ifndef INETD_UNSUPPORT_BILTIN 616#ifdef INETD_FEATURE_ENABLED
626 cp->se_bi == 0 && 617 cp->se_bi == 0 &&
627#endif 618#endif
628 (sep->se_wait == 1 || cp->se_wait == 0)) 619 (sep->se_wait == 1 || cp->se_wait == 0))
@@ -796,17 +787,17 @@ inetd_main(int argc, char *argv[])
796 char *sq; 787 char *sq;
797 gid_t gid; 788 gid_t gid;
798 789
799#ifdef INETD_UNSUPPORT_BILTIN 790#ifdef INETD_FEATURE_ENABLED
800# define dofork 1
801#else
802 int dofork; 791 int dofork;
803 extern char **environ; 792 extern char **environ;
793#else
794# define dofork 1
804#endif 795#endif
805 796
806 gid = getgid(); 797 gid = getgid();
807 setgroups(1, &gid); 798 setgroups(1, &gid);
808 799
809#ifndef INETD_UNSUPPORT_BILTIN 800#ifdef INETD_FEATURE_ENABLED
810 Argv = argv; 801 Argv = argv;
811 if (environ == 0 || *environ == 0) 802 if (environ == 0 || *environ == 0)
812 environ = argv; 803 environ = argv;
@@ -929,7 +920,7 @@ inetd_main(int argc, char *argv[])
929 ctrl = sep->se_fd; 920 ctrl = sep->se_fd;
930 sigprocmask(SIG_BLOCK, &blockmask, NULL); 921 sigprocmask(SIG_BLOCK, &blockmask, NULL);
931 pid = 0; 922 pid = 0;
932#ifndef INETD_UNSUPPORT_BILTIN 923#ifdef INETD_FEATURE_ENABLED
933 dofork = (sep->se_bi == 0 || sep->se_bi->bi_fork); 924 dofork = (sep->se_bi == 0 || sep->se_bi->bi_fork);
934#endif 925#endif
935 if (dofork) { 926 if (dofork) {
@@ -979,7 +970,7 @@ inetd_main(int argc, char *argv[])
979 } 970 }
980 sigprocmask(SIG_SETMASK, &emptymask, NULL); 971 sigprocmask(SIG_SETMASK, &emptymask, NULL);
981 if (pid == 0) { 972 if (pid == 0) {
982#ifndef INETD_UNSUPPORT_BILTIN 973#ifdef INETD_FEATURE_ENABLED
983 if (sep->se_bi) 974 if (sep->se_bi)
984 (*sep->se_bi->bi_fn)(ctrl, sep); 975 (*sep->se_bi->bi_fn)(ctrl, sep);
985 else 976 else