This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] openpty: use TIOCGPTPEER to open slave side fd


On Mon, Aug 28, 2017 at 09:34:11AM +0200, Florian Weimer wrote:
> On 08/26/2017 03:44 PM, Christian Brauner wrote:
> > +#ifdef TIOCGPTPEER
> > +  slave = ioctl (master, TIOCGPTPEER, O_RDWR | O_NOCTTY);
> > +#else
> >    if (pts_name (master, &buf, sizeof (_buf)))
> >      goto fail;
> >  
> >    slave = open (buf, O_RDWR | O_NOCTTY);
> > +#endif
> 
> I don't think you can #ifdef out existing code this way without
> introducing failures on older kernels.  You need to try the ioctl first,
> and if that fails, use the old pts_name code.

Cool. Will resend the [PATCH 2/2] soon. I take it that [PATH 1/1] holds up as it
stands.

Thanks!
Christian

> 
> Thanks,
> Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]