Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148381356
D32300.1786551426.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D32300.1786551426.diff
View Options
Index: usr.sbin/inetd/builtins.c
===================================================================
--- usr.sbin/inetd/builtins.c
+++ usr.sbin/inetd/builtins.c
@@ -75,11 +75,11 @@
struct biltin biltins[] = {
/* Echo received data */
- { "echo", SOCK_STREAM, 1, -1, echo_stream },
+ { "echo", SOCK_STREAM, BIF_FORK, -1, echo_stream },
{ "echo", SOCK_DGRAM, 0, 1, echo_dg },
/* Internet /dev/null */
- { "discard", SOCK_STREAM, 1, -1, discard_stream },
+ { "discard", SOCK_STREAM, BIF_FORK, -1, discard_stream },
{ "discard", SOCK_DGRAM, 0, 1, discard_dg },
/* Return 32 bit time since 1900 */
@@ -91,12 +91,12 @@
{ "daytime", SOCK_DGRAM, 0, 1, daytime_dg },
/* Familiar character generator */
- { "chargen", SOCK_STREAM, 1, -1, chargen_stream },
+ { "chargen", SOCK_STREAM, BIF_FORK, -1, chargen_stream },
{ "chargen", SOCK_DGRAM, 0, 1, chargen_dg },
- { "tcpmux", SOCK_STREAM, 1, -1, (bi_fn_t *)tcpmux },
+ { "tcpmux", SOCK_STREAM, BIF_FORK, -1, (bi_fn_t *)tcpmux },
- { "auth", SOCK_STREAM, 1, -1, ident_stream },
+ { "auth", SOCK_STREAM, BIF_FORK, -1, ident_stream },
{ NULL, 0, 0, 0, NULL }
};
Index: usr.sbin/inetd/inetd.h
===================================================================
--- usr.sbin/inetd/inetd.h
+++ usr.sbin/inetd/inetd.h
@@ -146,8 +146,13 @@
struct biltin {
const char *bi_service; /* internally provided service name */
int bi_socktype; /* type of socket supported */
- short bi_fork; /* 1 if should fork before call */
+ short bi_flags; /* BIF_* flags below */
int bi_maxchild; /* max number of children, -1=default */
bi_fn_t *bi_fn; /* function which performs it */
};
extern struct biltin biltins[];
+
+#define BIF_FORK 0x0001 /* should fork before call */
+
+#define SERVTAB_FORK(sep) \
+ ((sep)->se_bi == NULL || ((sep)->se_bi->bi_flags & BIF_FORK) != 0)
Index: usr.sbin/inetd/inetd.c
===================================================================
--- usr.sbin/inetd/inetd.c
+++ usr.sbin/inetd/inetd.c
@@ -623,7 +623,7 @@
n--;
if (debug)
warnx("someone wants %s", sep->se_service);
- dofork = !sep->se_bi || sep->se_bi->bi_fork || ISWRAP(sep);
+ dofork = SERVTAB_FORK(sep) || ISWRAP(sep);
conn = NULL;
if (sep->se_accept && sep->se_socktype == SOCK_STREAM) {
i = 1;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 12, 4:17 PM (8 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29399607
Default Alt Text
D32300.1786551426.diff (2 KB)
Attached To
Mode
D32300: inetd: convert bi_fork to a flag field
Attached
Detach File
Event Timeline
Log In to Comment