From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82157 invoked by alias); 28 Aug 2017 11:14:37 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 82143 invoked by uid 89); 28 Aug 2017 11:14:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*RU:gmail.com, Hx-spam-relays-external:gmail.com, H*r:gmail.com, cool X-HELO: youngberry.canonical.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=54GIkW9pwNyD1KTsXVrekuMkHX9OCSto0FUWmIZ61Vk=; b=TJ4PATV+UWLH9DNq7pn6frhwGYwDo3sGzjf/XYCWKguP7GQ53GQanyrTBIW6COg3wf sNRyS4OxKqpwn8ATTwRlDUt+FmDXDnt15zHL9M9VZK8BlNkSSz6UdtW7mtjd4GkHT8jf JNwjNY3fDwQYTmSO1jIvUH4xPditmnnpAXaoOLD14d20gq8FTluG7O3dUiSG9wr0B7mE eJX15mq2nW5e2NNu38OVyjTNYrYszWqNfMjLPGkT2mABpwLAlzODdn8fNLGZusNMGxt4 U5jkLDfNvrK6vBtWb4feAtnpmAh7z2AExLDv9C/6R0nImJDZHgCOWnRqM6HymLsAOXMT SmNw== X-Gm-Message-State: AHYfb5iOBukTVUmHpmfcKUy5qDsOuvvWPRKXUVGO3YAqZIGFAiD/XHmg AVZxBhc7JAfp8yU9ySuJr2A1qzHyKM50hkiVX3Waxw2se5AmB47iS3QmqRn+KeDNsFPJeP3YUwU ERe36Ayx4OHo32L+QnPP3edBZXUs/ X-Received: by 10.28.48.214 with SMTP id w205mr192935wmw.18.1503918872719; Mon, 28 Aug 2017 04:14:32 -0700 (PDT) X-Received: by 10.28.48.214 with SMTP id w205mr192922wmw.18.1503918872484; Mon, 28 Aug 2017 04:14:32 -0700 (PDT) Date: Mon, 28 Aug 2017 11:14:00 -0000 From: Christian Brauner To: Florian Weimer Cc: Christian Brauner , libc-alpha@sourceware.org, stgraber@stgraber.org, serge@hallyn.com Subject: Re: [PATCH 2/2] openpty: use TIOCGPTPEER to open slave side fd Message-ID: <20170828111430.34xk2lijrmeliuzf@gmail.com> References: <20170826134449.26527-1-christian.brauner@ubuntu.com> <20170826134449.26527-2-christian.brauner@ubuntu.com> <3496d984-a55e-d56b-2c25-a23200327dca@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <3496d984-a55e-d56b-2c25-a23200327dca@redhat.com> User-Agent: NeoMutt/20170609 (1.8.3) X-SW-Source: 2017-08/txt/msg01184.txt.bz2 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