On Sat, Jul 22 2017, Anton Lindqvist <[email protected]> wrote:
> Hi,
> This changes the behavior of the example but makes it consistent with
> the example in fgetln(3) and many other manuals.
>
> Comments? OK?
getline(3) and perror(3) are in posix, but fgetln(3) and err(3) come
from 4.4BSD (according to their manpage). We should probably keep the
example code posix-compliant.
> Index: getdelim.3
> ===================================================================
> RCS file: /cvs/src/lib/libc/stdio/getdelim.3,v
> retrieving revision 1.4
> diff -u -p -r1.4 getdelim.3
> --- getdelim.3 4 Apr 2016 19:23:52 -0000 1.4
> +++ getdelim.3 22 Jul 2017 08:51:16 -0000
> @@ -124,7 +124,7 @@ while ((linelen = getline(\*[Am]line, \*
>
> free(line);
> if (ferror(fp))
> - perror("getline");
> + err(1, "getline");
> .Ed
> .Sh ERRORS
> .Bl -tag -width [EOVERFLOW]
>
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE