From 9133b79b4fae126bbcd95dad6f2cac68329c8ff3 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 28 Sep 1999 04:54:04 +0000 Subject: Update. 1999-09-27 Andreas Jaeger * resolv/netdb.h: Remove declaration of getnodebyname. It has been renamed to getipnodebyname. Move flags around. 1999-09-27 Andreas Schwab * manual/message.texi (Locating gettext catalog): Fix typos. 1999-09-27 Andreas Jaeger * manual/socket.texi (Out-of-Band Data): Correct example program, rename some variables for clarity. Reported by James Antill , close PR libc/1329. --- manual/socket.texi | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'manual/socket.texi') diff --git a/manual/socket.texi b/manual/socket.texi index 53bdc5b..0c8fef3f 100644 --- a/manual/socket.texi +++ b/manual/socket.texi @@ -2512,7 +2512,7 @@ makes room. Here is an example: @smallexample struct buffer @{ - char *buffer; + char *buf; int size; struct buffer *next; @}; @@ -2536,18 +2536,19 @@ read_oob (int socket) @{ /* @r{This is an arbitrary limit.} @r{Does anyone know how to do this without a limit?} */ - char *buffer = (char *) xmalloc (1024); +#define BUF_SZ 1024 + char *buf = (char *) xmalloc (BUF_SZ); int success; int atmark; /* @r{Try again to read the out-of-band data.} */ - success = recv (socket, buffer, sizeof buffer, MSG_OOB); + success = recv (socket, buf, BUF_SZ, MSG_OOB); if (success >= 0) @{ /* @r{We got it, so return it.} */ struct buffer *link = (struct buffer *) xmalloc (sizeof (struct buffer)); - link->buffer = buffer; + link->buf = buf; link->size = success; link->next = list; return link; @@ -2568,7 +2569,7 @@ read_oob (int socket) /* @r{Otherwise, read a bunch of ordinary data and save it.} @r{This is guaranteed not to read past the mark} @r{if it starts before the mark.} */ - success = read (socket, buffer, sizeof buffer); + success = read (socket, buf, BUF_SZ); if (success < 0) perror ("read"); @@ -2576,7 +2577,7 @@ read_oob (int socket) @{ struct buffer *link = (struct buffer *) xmalloc (sizeof (struct buffer)); - link->buffer = buffer; + link->buf = buf; link->size = success; /* @r{Add the new link to the end of the list.} */ -- cgit v1.1