[PATCH 1/1] linux ttyname: return link if appropriate

Mike Frysinger vapier@gentoo.org
Fri Apr 15 19:59:00 GMT 2016


On 15 Apr 2016 18:47, Serge Hallyn wrote:
> Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>

we don't use s-o-b tags

> +/*
> + * Return true if this is a UNIX98 pty device, as defined in
> + * linux/Documentation/devices.txt
> + */

GNU style is:

/* Return true if this is a UNIX98 pty device, as defined in
   linux/Documentation/devices.txt.  */

this applies to comments below too

> +      if (is_pty (st) && strlen (procname) < buflen - 1)
> +        {
> +          memcpy (ttyname_buf, procname, strlen (procname));
> +          ttyname_buf[strlen (procname)] = '\0';

since you already verified buflen, why not use strcpy ?

also, GNU style says 8 spaces -> 1 tab
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160415/2f593ad3/attachment.sig>


More information about the Libc-alpha mailing list