GNU bug report logs -
#41099
28.0.50; TRAMP process-file ignores exit status of remote process
Previous Next
Reported by: Philipp Stephani <p.stephani2 <at> gmail.com>
Date: Tue, 5 May 2020 18:50:02 UTC
Severity: normal
Found in version 28.0.50
Fixed in version 27.2
Done: Philipp Stephani <p.stephani2 <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #46 received at 41099 <at> debbugs.gnu.org (full text, mbox):
Am Mi., 6. Mai 2020 um 19:56 Uhr schrieb Philipp Stephani
<p.stephani2 <at> gmail.com>:
>
> Am Mi., 6. Mai 2020 um 19:30 Uhr schrieb Michael Albinus
> <michael.albinus <at> gmx.de>:
> >
> > Philipp Stephani <p.stephani2 <at> gmail.com> writes:
> >
> > Hi Philipp,
> >
> > >> As a second step, consider also translating signals: if the exit code
> > >> is > 128, subtract 128 and return an appropriate string, like
> > >> call-process does.
> > >
> > > Try
> > > (call-process "bash" nil nil nil "-c" "kill -SYS $$")
> > > "Bad system call"
> >
> > I see. Hmm, this would require to install a trap handler in the remote
> > shell, and to add a mechanism transferring its result back to
> > Tramp. Don't know whether this is worth the effort.
>
> That wouldn't work because Bash translates signals from subprocesses:
>
> $ bash -c 'kill -SYS $$'; echo $?
> Bad system call (core dumped)
> 159
>
> The 159 here is 128 + the signal number.
What I suggest here would be something like the following:
(defun tramp-process-file (...)
(let ((code (...original code...)))
(if (> code 128)
;; Probably a signal
(format "Signal %d" (- code 128))
code))
This bug report was last modified 5 years and 83 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.