summaryrefslogtreecommitdiffstats
path: root/usr.sbin/inetd/builtins.c
diff options
context:
space:
mode:
authorsheldonh <sheldonh@FreeBSD.org>2000-03-28 09:45:19 +0000
committersheldonh <sheldonh@FreeBSD.org>2000-03-28 09:45:19 +0000
commit65439ee8c698efed9d098c3b969108aa8a24b99c (patch)
treef5ae96ee933bd16ab6630afb1f8cd88a433a8a9d /usr.sbin/inetd/builtins.c
parente18d9de5372ddda5d7f9cff0078a3f39fc342097 (diff)
downloadFreeBSD-src-65439ee8c698efed9d098c3b969108aa8a24b99c.zip
FreeBSD-src-65439ee8c698efed9d098c3b969108aa8a24b99c.tar.gz
Optimize those services that send only one block of data: use send(2)
with the MSG_EOF flag set instead of write(2). Submitted by: David Malone <dwmalone@maths.tcd.ie> Reviewed by: wollman
Diffstat (limited to 'usr.sbin/inetd/builtins.c')
-rw-r--r--usr.sbin/inetd/builtins.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/inetd/builtins.c b/usr.sbin/inetd/builtins.c
index fae9d17..7340c78 100644
--- a/usr.sbin/inetd/builtins.c
+++ b/usr.sbin/inetd/builtins.c
@@ -219,7 +219,7 @@ daytime_stream(s, sep) /* Return human-readable time of day */
clock = time((time_t *) 0);
(void) sprintf(buffer, "%.24s\r\n", ctime(&clock));
- (void) write(s, buffer, strlen(buffer));
+ (void) send(s, buffer, strlen(buffer), MSG_EOF);
}
/*
@@ -320,7 +320,7 @@ iderror(lport, fport, s, er) /* Generic ident_stream error-sending func */
syslog(LOG_ERR, "asprintf: %m");
exit(EX_OSERR);
}
- write(s, p, strlen(p));
+ send(s, p, strlen(p), MSG_EOF);
free(p);
exit(0);
@@ -614,7 +614,7 @@ printit:
syslog(LOG_ERR, "asprintf: %m");
exit(EX_OSERR);
}
- write(s, p, strlen(p));
+ send(s, p, strlen(p), MSG_EOF);
free(p);
exit(0);
@@ -676,7 +676,7 @@ machtime_stream(s, sep)
unsigned long result;
result = machtime();
- (void) write(s, (char *) &result, sizeof(result));
+ (void) send(s, (char *) &result, sizeof(result), MSG_EOF);
}
/*
OpenPOWER on IntegriCloud