summaryrefslogtreecommitdiff
path: root/networking/inetd.c
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2004-01-17 01:44:32 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2004-01-17 01:44:32 +0000
commit3e77b4e954538af865c2b54e5713d7bc2e6791ba (patch)
tree69b32f983b3d8cc98b5dcdf7d0a588361e04c7fb /networking/inetd.c
parentc3b134f3b735bffd34a07efe9004627d0b29a287 (diff)
downloadbusybox-w32-3e77b4e954538af865c2b54e5713d7bc2e6791ba.tar.gz
busybox-w32-3e77b4e954538af865c2b54e5713d7bc2e6791ba.tar.bz2
busybox-w32-3e77b4e954538af865c2b54e5713d7bc2e6791ba.zip
Remove some defined statements
Diffstat (limited to 'networking/inetd.c')
-rw-r--r--networking/inetd.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/networking/inetd.c b/networking/inetd.c
index c594a67f2..8491fc38c 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -134,10 +134,6 @@
134#define _PATH_INETDCONF "/etc/inetd.conf" 134#define _PATH_INETDCONF "/etc/inetd.conf"
135#define _PATH_INETDPID "/var/run/inetd.pid" 135#define _PATH_INETDPID "/var/run/inetd.pid"
136 136
137#ifndef MIN
138#define MIN(a, b) ((a) < (b) ? (a) : (b))
139#endif
140
141#define TOOMANY 40 /* don't start more than TOOMANY */ 137#define TOOMANY 40 /* don't start more than TOOMANY */
142#define CNT_INTVL 60 /* servers in CNT_INTVL sec. */ 138#define CNT_INTVL 60 /* servers in CNT_INTVL sec. */
143#define RETRYTIME (60*10) /* retry after bind or server fail */ 139#define RETRYTIME (60*10) /* retry after bind or server fail */
@@ -270,11 +266,8 @@ static const struct biltin biltins[] = {
270}; 266};
271#endif /* INETD_FEATURE_ENABLED */ 267#endif /* INETD_FEATURE_ENABLED */
272 268
273#define NUMINT (sizeof(intab) / sizeof(struct inent))
274static const char *CONFIG = _PATH_INETDCONF; 269static const char *CONFIG = _PATH_INETDCONF;
275 270
276#define BCOPY(s, d, z) memcpy(d, s, z)
277
278static void 271static void
279syslog_err_and_discard_dg(int se_socktype, const char *msg, ...) 272syslog_err_and_discard_dg(int se_socktype, const char *msg, ...)
280 __attribute__ ((noreturn, format (printf, 2, 3))); 273 __attribute__ ((noreturn, format (printf, 2, 3)));
@@ -519,7 +512,7 @@ bump_nofile(void)
519 syslog(LOG_ERR, "getrlimit: %m"); 512 syslog(LOG_ERR, "getrlimit: %m");
520 return -1; 513 return -1;
521 } 514 }
522 rl.rlim_cur = MIN(rl.rlim_max, rl.rlim_cur + FD_CHUNK); 515 rl.rlim_cur = rl.rlim_max < (rl.rlim_cur + FD_CHUNK) ? rl.rlim_max : (rl.rlim_cur + FD_CHUNK);
523 if (rl.rlim_cur <= rlim_ofile_cur) { 516 if (rl.rlim_cur <= rlim_ofile_cur) {
524 syslog(LOG_ERR, 517 syslog(LOG_ERR,
525#if _FILE_OFFSET_BITS == 64 518#if _FILE_OFFSET_BITS == 64
@@ -1142,10 +1135,10 @@ chargen_stream(int s, struct servtab *sep)
1142 text[LINESIZ + 1] = '\n'; 1135 text[LINESIZ + 1] = '\n';
1143 for (rs = ring;;) { 1136 for (rs = ring;;) {
1144 if ((len = endring - rs) >= LINESIZ) 1137 if ((len = endring - rs) >= LINESIZ)
1145 BCOPY(rs, text, LINESIZ); 1138 memcpy(rs, text, LINESIZ);
1146 else { 1139 else {
1147 BCOPY(rs, text, len); 1140 memcpy(rs, text, len);
1148 BCOPY(ring, text + len, LINESIZ - len); 1141 memcpy(ring, text + len, LINESIZ - len);
1149 } 1142 }
1150 if (++rs == endring) 1143 if (++rs == endring)
1151 rs = ring; 1144 rs = ring;
@@ -1176,10 +1169,10 @@ chargen_dg(int s, struct servtab *sep)
1176 return; 1169 return;
1177 1170
1178 if ((len = endring - rs) >= LINESIZ) 1171 if ((len = endring - rs) >= LINESIZ)
1179 BCOPY(rs, text, LINESIZ); 1172 memcpy(rs, text, LINESIZ);
1180 else { 1173 else {
1181 BCOPY(rs, text, len); 1174 memcpy(rs, text, len);
1182 BCOPY(ring, text + len, LINESIZ - len); 1175 memcpy(ring, text + len, LINESIZ - len);
1183 } 1176 }
1184 if (++rs == endring) 1177 if (++rs == endring)
1185 rs = ring; 1178 rs = ring;