Function: tramp-adb-get-signal-strings

tramp-adb-get-signal-strings is a byte-compiled function defined in tramp-adb.el.gz.

Signature

(tramp-adb-get-signal-strings VEC)

Documentation

Strings to return by process-file in case of signals.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-adb.el.gz
(defun tramp-adb-get-signal-strings (vec)
  "Strings to return by `process-file' in case of signals."
  (with-tramp-connection-property vec "signal-strings"
    (let ((default-directory (tramp-make-tramp-file-name vec 'localname))
	  ;; `shell-file-name' and `shell-command-switch' are needed
	  ;; for Emacs < 27.1, which doesn't support connection-local
	  ;; variables in `shell-command'.
	  (shell-file-name "/system/bin/sh")
	  (shell-command-switch "-c")
	  process-file-return-signal-string signals result)
      (dotimes (i 128) (push (format "Signal %d" i) result))
      (setq result (reverse result)
	    signals (split-string
		     (shell-command-to-string "COLUMNS=40 kill -l") "\n" 'omit))
      (setcar result 0)
      (dolist (line signals)
	(when (string-match
	       (concat
		"^[[:space:]]*\\([[:digit:]]+\\)"
		"[[:space:]]+\\S-+[[:space:]]+"
		"\\([[:alpha:]].*\\)$")
	       line)
	  (setcar
	   (nthcdr (string-to-number (match-string 1 line)) result)
	   (match-string 2 line))))
      result)))