unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: 白井彰 <okshirai@gmail.com>
To: Wolfgang Jenkner <wjenkner@inode.at>
Cc: Akira Shirai <okshirai@gmail.com>, 19191@debbugs.gnu.org
Subject: bug#19191: 24.4; su command in *shell* buffer does not work
Date: Fri, 3 Apr 2015 01:56:57 +0900	[thread overview]
Message-ID: <FBD9CF5B-EA27-4837-8EBC-A6C401C55DF3@gmail.com> (raw)
In-Reply-To: <85k2xw7y9a.fsf@iznogoud.viz>

[-- Attachment #1: Type: text/plain, Size: 4216 bytes --]

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 = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = 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") == -1) fatal ("ioctl I_PUSH ptem"); if (ioctl (xforkin, I_PUSH, "ldterm") == -1) fatal ("ioctl I_PUSH ldterm"); if (ioctl (xforkin, I_PUSH, "ttcompat") == -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 = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = 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") == -1) fatal ("ioctl I_PUSH ptem"); if (ioctl (xforkin, I_PUSH, "ldterm") == -1) fatal ("ioctl I_PUSH ldterm"); if (ioctl (xforkin, I_PUSH, "ttcompat") == -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 = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = 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 = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = 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、Wolfgang Jenkner <wjenkner@inode.at> のメール:
> 
> 


[-- Attachment #2: Type: text/html, Size: 6205 bytes --]

  reply	other threads:[~2015-04-02 16:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26 10:00 bug#19191: 24.4; su command in *shell* buffer does not work 白井彰
2014-11-26 11:13 ` Andreas Schwab
2014-11-27 16:33   ` 白井彰
2014-11-27 17:14     ` Andreas Schwab
2014-11-28  9:25       ` 白井彰
2014-12-06 11:15 ` 白井彰
2015-03-16 16:36 ` 白井彰
2015-03-30 17:08 ` 白井彰
2015-03-30 17:22   ` Eli Zaretskii
2015-04-01 11:54     ` 白井彰
2015-04-01 13:49       ` Wolfgang Jenkner
2015-04-02 16:56         ` 白井彰 [this message]
2015-04-13 16:43 ` 白井彰

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FBD9CF5B-EA27-4837-8EBC-A6C401C55DF3@gmail.com \
    --to=okshirai@gmail.com \
    --cc=19191@debbugs.gnu.org \
    --cc=wjenkner@inode.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).