This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/1] linux ttyname: return link if appropriate
- From: Serge Hallyn <serge dot hallyn at ubuntu dot com>
- To: Florian Weimer <fweimer at redhat dot com>, libc-alpha at sourceware dot org
- Cc: Mike Frysinger <vapier at gentoo dot org>, Serge Hallyn <serge dot hallyn at ubuntu dot com>
- Date: Mon, 18 Apr 2016 19:52:44 +0000
- Subject: Re: [PATCH 1/1] linux ttyname: return link if appropriate
- Authentication-results: sourceware.org; auth=none
- References: <20160415152929 dot GA7932 at ubuntumail> <5711165D dot 5040902 at redhat dot com> <20160415164652 dot GE8450 at ubuntumail> <57111F9C dot 8030902 at redhat dot com> <20160415174245 dot GA9610 at ubuntumail> <20160415184746 dot GA10830 at ubuntumail> <20160415195938 dot GP6588 at vapier dot lan>
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