summaryrefslogtreecommitdiffstats
path: root/usr.sbin/inetd/builtins.c
diff options
context:
space:
mode:
authorsheldonh <sheldonh@FreeBSD.org>1999-07-24 12:35:50 +0000
committersheldonh <sheldonh@FreeBSD.org>1999-07-24 12:35:50 +0000
commit6a2357f795976ce206bf0022b03126b6c9c626cb (patch)
tree6ee4df11329d4cb1a20ab23ddeddc96ad75f0dbe /usr.sbin/inetd/builtins.c
parentfc47ca2b346d4e1299e65906af5eb641d2754cb3 (diff)
downloadFreeBSD-src-6a2357f795976ce206bf0022b03126b6c9c626cb.zip
FreeBSD-src-6a2357f795976ce206bf0022b03126b6c9c626cb.tar.gz
Style nits:
* Bring memory allocation failure handling in line with that of the rest of the code. * Nestle block curlies between case statements correctly. I've left the in-block declarations alone, since style(9) says we should conform to the existing style within the code, and inetd already does this. I've left the asprintf()'s in there because that's how Brian wants it.
Diffstat (limited to 'usr.sbin/inetd/builtins.c')
-rw-r--r--usr.sbin/inetd/builtins.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/inetd/builtins.c b/usr.sbin/inetd/builtins.c
index 1f60f25..73eb879 100644
--- a/usr.sbin/inetd/builtins.c
+++ b/usr.sbin/inetd/builtins.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: builtins.c,v 1.6 1999/07/23 15:26:42 sheldonh Exp $
+ * $Id: builtins.c,v 1.7 1999/07/23 15:49:14 green Exp $
*
*/
@@ -290,7 +290,7 @@ iderror(lport, fport, s, er)
asprintf(&p, "%d , %d : ERROR : %s\r\n", lport, fport,
er == -1 ? "HIDDEN-USER" : er ? strerror(er) : "UNKNOWN-ERROR");
if (p == NULL) {
- syslog(LOG_ERR, "asprintf: %s", strerror(errno));
+ syslog(LOG_ERR, "Out of memory.");
exit(EX_OSERR);
}
write(s, p, strlen(p));
@@ -334,7 +334,8 @@ ident_stream(s, sep) /* Ident service */
case 'o':
osname = optarg;
break;
- case 't': {
+ case 't':
+ {
int sec, usec;
switch (sscanf(optarg, "%d.%d", &sec, &usec)) {
@@ -424,8 +425,10 @@ ident_stream(s, sep) /* Ident service */
cp = pw->pw_name;
printit:
if (asprintf(&p, "%d , %d : USERID : %s : %s\r\n", lport, fport, osname,
- cp) == -1)
- iderror(0, 0, s, errno);
+ cp) == -1) {
+ syslog(LOG_ERR, "Out of memory.");
+ exit(EX_OSERR);
+ }
write(s, p, strlen(p));
free(p);
OpenPOWER on IntegriCloud