GNU bug report logs -
#19191
24.4; su command in *shell* buffer does not work
Previous Next
Reported by: 白井彰 <okshirai <at> gmail.com>
Date: Wed, 26 Nov 2014 10:02:02 UTC
Severity: normal
Merged with 19927,
20555,
20686
Found in versions 24.4, 24.4.90
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
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 <at> inode.at> のメール:
>
>
[Message part 2 (text/html, inline)]
This bug report was last modified 10 years and 13 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.