From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?=E7=99=BD=E4=BA=95=E5=BD=B0?= Newsgroups: gmane.emacs.bugs Subject: bug#20555: Emacs 24.2 vs 24.4 on Solaris: M-x shell and "tty => not a tty" Date: Tue, 2 Jun 2015 01:53:12 +0900 Message-ID: <9051A319-D257-400F-B74E-C46B2C14D8F3@gmail.com> References: <555198E2.30809@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1433177665 1896 80.91.229.3 (1 Jun 2015 16:54:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Jun 2015 16:54:25 +0000 (UTC) Cc: Akira Shirai To: 20555@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 01 18:54:14 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YzSyb-0001pa-JO for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Jun 2015 18:54:13 +0200 Original-Received: from localhost ([::1]:53489 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzSyb-0001mh-4d for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Jun 2015 12:54:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzSyW-0001hB-Qj for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2015 12:54:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzSyQ-0005gI-Qs for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2015 12:54:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzSyQ-0005g2-MW for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2015 12:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YzSyQ-0004Me-D6 for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2015 12:54:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <555198E2.30809@cs.ucla.edu> Resent-From: =?UTF-8?Q?=E7=99=BD=E4=BA=95=E5=BD=B0?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Jun 2015 16:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20555 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20555-submit@debbugs.gnu.org id=B20555.143317760716729 (code B ref 20555); Mon, 01 Jun 2015 16:54:02 +0000 Original-Received: (at 20555) by debbugs.gnu.org; 1 Jun 2015 16:53:27 +0000 Original-Received: from localhost ([127.0.0.1]:36348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzSxq-0004Ll-5Q for submit@debbugs.gnu.org; Mon, 01 Jun 2015 12:53:26 -0400 Original-Received: from mail-pd0-f195.google.com ([209.85.192.195]:33494) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzSxn-0004LX-OE for 20555@debbugs.gnu.org; Mon, 01 Jun 2015 12:53:24 -0400 Original-Received: by pdjp10 with SMTP id p10so17644092pdj.0 for <20555@debbugs.gnu.org>; Mon, 01 Jun 2015 09:53:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:date:message-id :cc:to:mime-version; bh=nwlakbCclbNu6eMkC+kbmZDl+qKrXALaOQxKEFpJefE=; b=rnaaV1H30QF+107QuHYv2heiptWunFIlIsv22MkkEBJUHsTOo3PcBkA5dpkITXPdYL e7MNWckmMhpZGpONHj1AESAAy6NJP04URiDshL3gVPehEPBxotWU71DT8UQxZyVpKUzT AzpgFCLk+EORIFv52/rQ1a9XND4+SdZ4R+E+aF/1zJ0dwODqd2ILlmaV0qNjKFYfDoRl icchBPkXGsfWeHB1hlq/nglKcncEw6fOQXz3DfSKBA5v5gW+2Kweve4sepjnvOxCuC7u ovHC/Vazks22wNe7vZDLaQBk3uMsqdKv9J0xpniIvCpSuMJ/svMjCe3sOeKzhhIHbVcl zjQQ== X-Received: by 10.70.140.38 with SMTP id rd6mr41866612pdb.47.1433177597762; Mon, 01 Jun 2015 09:53:17 -0700 (PDT) Original-Received: from [172.20.10.11] (pw126254132031.8.panda-world.ne.jp. [126.254.132.31]) by mx.google.com with ESMTPSA id zt9sm15095210pac.9.2015.06.01.09.53.14 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Jun 2015 09:53:16 -0700 (PDT) X-Mailer: Apple Mail (2.2098) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103445 Archived-At: I wrote a small program my-emacs-24.5.c, and found that grantpt(fd) returned -1 after fcntl(fd, F_SETFD, FD_CLOEXEC). Without fcntl(fd, F_SETFD, FD_CLOEXEC), grantpt(fd) returns 0. aaa% sh emacs-24.5/build-aux/config.guess i386-pc-solaris2.10 aaa% ls my-emacs-24.5.c my-emacs-24.5.c aaa% make my-emacs-24.5 && ./my-emacs-24.5 cc -o my-emacs-24.5 my-emacs-24.5.c call_fcntl_fd_cloexec: 1 fcntl_result: 0 fd: 3 grantpt_result: -1 errno: 13 grantpt: Permission denied aaa% make my-emacs-24.5 && ./my-emacs-24.5 call_fcntl_fd_cloexec=3D0 `my-emacs-24.5' is up to date. call_fcntl_fd_cloexec: 0 fd: 3 grantpt_result: 0 bbb% sh emacs-24.5/build-aux/config.guess sparc-sun-solaris2.8 bbb% rm my-emacs-24.5 bbb% make my-emacs-24.5 && ./my-emacs-24.5 cc -o my-emacs-24.5 my-emacs-24.5.c call_fcntl_fd_cloexec: 1 fcntl_result: 0 fd: 3 grantpt_result: -1 errno: 0 grantpt: Error 0 bbb% make my-emacs-24.5 && ./my-emacs-24.5 call_fcntl_fd_cloexec=3D0 `my-emacs-24.5' is up to date. call_fcntl_fd_cloexec: 0 fd: 3 grantpt_result: 0 % cat -n my-emacs-24.5.c 1 /* 24.5 */ 2 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 12 int call_fcntl_fd_cloexec; 13 14 enum { PTY_NAME_SIZE =3D 24 }; 15 16 int emacs_open(const char *file, int oflags, int mode) { 17 #define O_CLOEXEC 0 18 int fd; 19 oflags |=3D O_CLOEXEC; 20 while ((fd =3D open(file, oflags, mode)) < 0 && errno =3D=3D = EINTR) abort(); 21 if (! O_CLOEXEC && 0 <=3D fd) { 22 fprintf(stderr, "call_fcntl_fd_cloexec: %d\n", = call_fcntl_fd_cloexec); 23 if (call_fcntl_fd_cloexec) { 24 int fcntl_result =3D fcntl(fd, F_SETFD, FD_CLOEXEC); 25 fprintf(stderr, "fcntl_result: %d\n", fcntl_result); 26 } 27 } 28 return fd; 29 } 30 31 static int allocate_pty(char pty_name[PTY_NAME_SIZE]) { 32 int fd; 33 strcpy(pty_name, "/dev/ptmx"); 34 fd =3D emacs_open(pty_name, O_RDWR | O_NONBLOCK, 0); 35 fprintf(stderr, "fd: %d\n", fd); 36 if (fd >=3D 0) { 37 int grantpt_result =3D grantpt(fd); 38 fprintf(stderr, "grantpt_result: %d\n", grantpt_result); 39 if (grantpt_result !=3D 0) { 40 fprintf(stderr, "errno: %d\n", errno); 41 perror("grantpt"); 42 } 43 } 44 return fd; 45 } 46 47 int main(int argc, char **argv) { 48 char pty_name[PTY_NAME_SIZE]; 49 if (argc =3D=3D 2) call_fcntl_fd_cloexec =3D 0; 50 else call_fcntl_fd_cloexec =3D 1; 51 allocate_pty(pty_name); 52 return 0; 53 }