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#19191: 24.4; su command in *shell* buffer does not work Date: Fri, 3 Apr 2015 01:56:57 +0900 Message-ID: References: <09A01C7C-6199-4883-84AC-2445080B3FBE@gmail.com> <019535E2-98FE-4BD1-891A-1A1DB287AEB6@gmail.com> <83wq1yxuwf.fsf@gnu.org> <85k2xw7y9a.fsf@iznogoud.viz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_74B91DB6-E938-4382-A153-61ECAB95B270" X-Trace: ger.gmane.org 1427993902 2779 80.91.229.3 (2 Apr 2015 16:58:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 2 Apr 2015 16:58:22 +0000 (UTC) Cc: Akira Shirai , 19191@debbugs.gnu.org To: Wolfgang Jenkner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 02 18:58:12 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 1YdiRW-0000N2-VU for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Apr 2015 18:58:11 +0200 Original-Received: from localhost ([::1]:59427 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdiRW-0003bG-GC for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Apr 2015 12:58:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdiRR-0003b7-8O for bug-gnu-emacs@gnu.org; Thu, 02 Apr 2015 12:58:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YdiRO-0003Lf-Cl for bug-gnu-emacs@gnu.org; Thu, 02 Apr 2015 12:58:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53684) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdiRO-0003Lb-9A for bug-gnu-emacs@gnu.org; Thu, 02 Apr 2015 12:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YdiRO-0001Wx-00 for bug-gnu-emacs@gnu.org; Thu, 02 Apr 2015 12:58:02 -0400 X-Loop: help-debbugs@gnu.org 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: Thu, 02 Apr 2015 16:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19191 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19191-submit@debbugs.gnu.org id=B19191.14279938375834 (code B ref 19191); Thu, 02 Apr 2015 16:58:01 +0000 Original-Received: (at 19191) by debbugs.gnu.org; 2 Apr 2015 16:57:17 +0000 Original-Received: from localhost ([127.0.0.1]:43460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YdiQe-0001W1-8J for submit@debbugs.gnu.org; Thu, 02 Apr 2015 12:57:17 -0400 Original-Received: from mail-pd0-f178.google.com ([209.85.192.178]:33414) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YdiQa-0001Vm-Ve for 19191@debbugs.gnu.org; Thu, 02 Apr 2015 12:57:14 -0400 Original-Received: by pdbnk13 with SMTP id nk13so14755613pdb.0 for <19191@debbugs.gnu.org>; Thu, 02 Apr 2015 09:57:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=4EUwoumwbyDCPLrbjP47Q601ABv04XjCfNqeMXDjXTs=; b=yPeZIejZjv64eg0RxGK+USP7h0UJxdrFLpHjkSyI5glOvANZQWot1U/W+ZcB0mUr6S cMmwwhRa/eKbZhO6TpKbHXrxguHlNBcra7FcOGGUANr5L7ZonPYGvKlrO5iAKQPnUpo2 LAKRRhkxzVWdCKx0+kSR9Sx6dnmLx3J39giOgvr26sv/SkiM/T+X0Hm5zQQ/DM41OtJx 6QLnSTanMJkltt4A+fAxV4xEkDgRAT6uA3HmNmWRY3hx1KjDuMH7p2o2nZ4csMjluVeK 7Pasd028jjkyyVGLcAEFWZAF8I2vxQNtsx173r4lHxTkj5vRk+ctzkD25epDjKw5IAXB B4Jg== X-Received: by 10.68.94.197 with SMTP id de5mr88800010pbb.57.1427993826946; Thu, 02 Apr 2015 09:57:06 -0700 (PDT) Original-Received: from [172.20.10.11] (pw126254214105.8.panda-world.ne.jp. [126.254.214.105]) by mx.google.com with ESMTPSA id ed5sm5732602pbd.19.2015.04.02.09.57.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 Apr 2015 09:57:05 -0700 (PDT) In-Reply-To: <85k2xw7y9a.fsf@iznogoud.viz> X-Mailer: Apple Mail (2.2070.6) 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:101141 Archived-At: --Apple-Mail=_74B91DB6-E938-4382-A153-61ECAB95B270 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Today I tried what you had suggested, but I could not find significant differences. % grep '#.*PTY' emacs-24.3/src/config.h > /tmp/config.h_PTY_emacs-24.3 % grep '#.*PTY' emacs-24.4/src/config.h > /tmp/config.h_PTY_emacs-24.4 % cat /tmp/config.h_PTY_emacs-24.3 /* #undef BROKEN_PTY_READ_AFTER_EAGAIN */ /* #undef DONT_REOPEN_PTY */ #define FIRST_PTY_LETTER 'z' #define HAVE_PTYS 1 /* #undef HAVE_PTY_H */ /* #undef PTY_ITERATION */ #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx"); /* #undef PTY_OPEN */ #define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; int = grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset = (&blocked, SIGCLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); = grantpt_result =3D grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, = 0); if (grantpt_result =3D=3D -1 || unlockpt (fd) =3D=3D -1 || !(ptyname = =3D ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, = sizeof pty_name, "%s", ptyname); } #define SETUP_SLAVE_PTY if (ioctl (xforkin, I_PUSH, "ptem") =3D=3D -1) = fatal ("ioctl I_PUSH ptem"); if (ioctl (xforkin, I_PUSH, "ldterm") =3D=3D = -1) fatal ("ioctl I_PUSH ldterm"); if (ioctl (xforkin, I_PUSH, = "ttcompat") =3D=3D -1) fatal ("ioctl I_PUSH ttcompat"); /* #undef UNIX98_PTYS */ % cat /tmp/config.h_PTY_emacs-24.4 /* #undef BROKEN_PTY_READ_AFTER_EAGAIN */ /* #undef DONT_REOPEN_PTY */ #define FIRST_PTY_LETTER 'z' #define HAVE_PTYS 1 /* #undef HAVE_PTY_H */ /* #undef PTY_ITERATION */ #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx"); /* #undef PTY_OPEN */ #define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; int = grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset = (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); = grantpt_result =3D grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, = 0); if (grantpt_result =3D=3D -1 || unlockpt (fd) =3D=3D -1 || !(ptyname = =3D ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, = PTY_NAME_SIZE, "%s", ptyname); } #define SETUP_SLAVE_PTY if (ioctl (xforkin, I_PUSH, "ptem") =3D=3D -1) = fatal ("ioctl I_PUSH ptem"); if (ioctl (xforkin, I_PUSH, "ldterm") =3D=3D = -1) fatal ("ioctl I_PUSH ldterm"); if (ioctl (xforkin, I_PUSH, = "ttcompat") =3D=3D -1) fatal ("ioctl I_PUSH ttcompat"); /* #undef UNIX98_PTYS */ % diff /tmp/config.h_PTY_emacs-24.3 /tmp/config.h_PTY_emacs-24.4 9c9 < #define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; int = grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset = (&blocked, SIGCLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); = grantpt_result =3D grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, = 0); if (grantpt_result =3D=3D -1 || unlockpt (fd) =3D=3D -1 || !(ptyname = =3D ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, = sizeof pty_name, "%s", ptyname); } --- > #define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; int = grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset = (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); = grantpt_result =3D grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, = 0); if (grantpt_result =3D=3D -1 || unlockpt (fd) =3D=3D -1 || !(ptyname = =3D ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, = PTY_NAME_SIZE, "%s", ptyname); } % cat /tmp/config.h_PTY_emacs-24.3 | grep PTY_TTY_NAME_SPRINTF | sed = 's/#define//' | indent -st > /tmp/config.h_PTY_emacs-24.3_indent-st % cat /tmp/config.h_PTY_emacs-24.4 | grep PTY_TTY_NAME_SPRINTF | sed = 's/#define//' | indent -st > /tmp/config.h_PTY_emacs-24.4_indent-st % diff /tmp/config.h_PTY_emacs-24.3_indent-st = /tmp/config.h_PTY_emacs-24.4_indent-st 6c6 < sigaddset(&blocked, SIGCLD); --- > sigaddset(&blocked, SIGCHLD); 13c13 < } snprintf(pty_name, sizeof pty_name, "%s", ptyname); --- > } snprintf(pty_name, PTY_NAME_SIZE, "%s", ptyname); And I replaced the definition of PTY_TTY_NAME_SPRINTF in emacs-24.4/src/config.h with the definition of PTY_TTY_NAME_SPRINTF in emacs-24.3/src/config.h and typed "make" and "emacs -Q", the emacs (almost emacs-24.4 except PTY_TTY_NAME_SPRINTF) still said "Warning: no access to tty; thus no job control in this shell...". > 2015/04/01 22:49=E3=80=81Wolfgang Jenkner = =E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB=EF=BC=9A >=20 >=20 --Apple-Mail=_74B91DB6-E938-4382-A153-61ECAB95B270 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Today I tried what you had suggested, but I = could not find significant
differences.

% grep '#.*PTY' = emacs-24.3/src/config.h > /tmp/config.h_PTY_emacs-24.3
% grep '#.*PTY' emacs-24.4/src/config.h > = /tmp/config.h_PTY_emacs-24.4

% cat = /tmp/config.h_PTY_emacs-24.3
/* #undef = BROKEN_PTY_READ_AFTER_EAGAIN */
/* #undef = DONT_REOPEN_PTY */
#define FIRST_PTY_LETTER = 'z'
#define HAVE_PTYS 1
/* = #undef HAVE_PTY_H */
/* #undef PTY_ITERATION = */
#define PTY_NAME_SPRINTF strcpy (pty_name, = "/dev/ptmx");
/* #undef PTY_OPEN */
#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; = int grantpt_result; sigset_t blocked; sigemptyset (&blocked); = sigaddset (&blocked, SIGCLD); pthread_sigmask (SIG_BLOCK, = &blocked, 0); grantpt_result =3D grantpt (fd); pthread_sigmask = (SIG_UNBLOCK, &blocked, 0); if (grantpt_result =3D=3D -1 || unlockpt = (fd) =3D=3D -1 || !(ptyname =3D ptsname (fd))) { emacs_close (fd); = return -1; } snprintf (pty_name, sizeof pty_name, "%s", ptyname); = }
#define SETUP_SLAVE_PTY if (ioctl (xforkin, = I_PUSH, "ptem") =3D=3D -1) fatal ("ioctl I_PUSH ptem"); if (ioctl = (xforkin, I_PUSH, "ldterm") =3D=3D -1) fatal ("ioctl I_PUSH ldterm"); if = (ioctl (xforkin, I_PUSH, "ttcompat") =3D=3D -1) fatal ("ioctl I_PUSH = ttcompat");
/* #undef UNIX98_PTYS */

% cat = /tmp/config.h_PTY_emacs-24.4
/* #undef = BROKEN_PTY_READ_AFTER_EAGAIN */
/* #undef = DONT_REOPEN_PTY */
#define FIRST_PTY_LETTER = 'z'
#define HAVE_PTYS 1
/* = #undef HAVE_PTY_H */
/* #undef PTY_ITERATION = */
#define PTY_NAME_SPRINTF strcpy (pty_name, = "/dev/ptmx");
/* #undef PTY_OPEN */
#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; = int grantpt_result; sigset_t blocked; sigemptyset (&blocked); = sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, = &blocked, 0); grantpt_result =3D grantpt (fd); pthread_sigmask = (SIG_UNBLOCK, &blocked, 0); if (grantpt_result =3D=3D -1 || unlockpt = (fd) =3D=3D -1 || !(ptyname =3D ptsname (fd))) { emacs_close (fd); = return -1; } snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); = }
#define SETUP_SLAVE_PTY if (ioctl (xforkin, = I_PUSH, "ptem") =3D=3D -1) fatal ("ioctl I_PUSH ptem"); if (ioctl = (xforkin, I_PUSH, "ldterm") =3D=3D -1) fatal ("ioctl I_PUSH ldterm"); if = (ioctl (xforkin, I_PUSH, "ttcompat") =3D=3D -1) fatal ("ioctl I_PUSH = ttcompat");
/* #undef UNIX98_PTYS */

% diff = /tmp/config.h_PTY_emacs-24.3 /tmp/config.h_PTY_emacs-24.4
9c9
< #define PTY_TTY_NAME_SPRINTF { = char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; = sigemptyset (&blocked); sigaddset (&blocked, SIGCLD); = pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result =3D grantpt = (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result = =3D=3D -1 || unlockpt (fd) =3D=3D -1 || !(ptyname =3D ptsname (fd))) { = emacs_close (fd); return -1; } snprintf (pty_name, sizeof pty_name, = "%s", ptyname); }
---
> = #define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; int = grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset = (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); = grantpt_result =3D grantpt (fd); pthread_sigmask (SIG_UNBLOCK, = &blocked, 0); if (grantpt_result =3D=3D -1 || unlockpt (fd) =3D=3D = -1 || !(ptyname =3D ptsname (fd))) { emacs_close (fd); return -1; } = snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }

% cat = /tmp/config.h_PTY_emacs-24.3 | grep PTY_TTY_NAME_SPRINTF | sed = 's/#define//' | indent -st > = /tmp/config.h_PTY_emacs-24.3_indent-st
% cat = /tmp/config.h_PTY_emacs-24.4 | grep PTY_TTY_NAME_SPRINTF | sed = 's/#define//' | indent -st > = /tmp/config.h_PTY_emacs-24.4_indent-st
% diff = /tmp/config.h_PTY_emacs-24.3_indent-st = /tmp/config.h_PTY_emacs-24.4_indent-st
6c6
<       sigaddset(&blocked, = SIGCLD);
---
>   =     sigaddset(&blocked, SIGCHLD);
13c13
<       } = snprintf(pty_name, sizeof pty_name, "%s", ptyname);
---
>       } = snprintf(pty_name, PTY_NAME_SIZE, "%s", ptyname);
And I replaced the definition of = PTY_TTY_NAME_SPRINTF in
emacs-24.4/src/config.h = with the definition of PTY_TTY_NAME_SPRINTF in
emacs-24.3/src/config.h and typed "make" and "emacs -Q", the = emacs
(almost emacs-24.4 except = PTY_TTY_NAME_SPRINTF) still said "Warning:
no = access to tty; thus no job control in this shell...".

2015/04/01 22:49=E3=80=81Wolfgang Jenkner = <wjenkner@inode.at> =E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB=EF= =BC=9A



= --Apple-Mail=_74B91DB6-E938-4382-A153-61ECAB95B270--