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

Serge Hallyn serge.hallyn@ubuntu.com
Mon Apr 18 19:53:00 GMT 2016


Quoting Mike Frysinger (vapier@gentoo.org):
> 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 ?

That actually had been my first inclination, not sure why I
switched it.

> also, GNU style says 8 spaces -> 1 tab
> -mike

There were a few other bugs as well.  Replying with a new patch.

thanks,
-serge



More information about the Libc-alpha mailing list