unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* process-file instead of call-process in proced.el?
@ 2022-03-25  0:09 Filipp Gunbin
  2022-03-25  6:54 ` Eli Zaretskii
  2022-03-26 16:49 ` Michael Albinus
  0 siblings, 2 replies; 30+ messages in thread
From: Filipp Gunbin @ 2022-03-25  0:09 UTC (permalink / raw)
  To: emacs-devel; +Cc: winkler

There's this TODO in proced.el:

--8<---------------cut here---------------start------------->8---
;; - Allow "sudo kill PID", "sudo renice PID"
--8<---------------cut here---------------end--------------->8---

WDYT, can we just use process-file instead of call-process?  Then, if
proced is opened from a /sudo:: (or su) buffer, and (setq
proced-signal-function "kill") is set, proced-send-signal "just works"
for processes owned by different user, with no special code in proced.

The simple patch is below.

Filipp.


diff --git a/lisp/proced.el b/lisp/proced.el
index c1d599afc4..7d324a37a3 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -1833,7 +1833,7 @@ proced-send-signal
         (dolist (process process-alist)
           (with-temp-buffer
             (condition-case nil
-                (unless (zerop (call-process
+                (unless (zerop (process-file
                                 proced-signal-function nil t nil
                                 signal (number-to-string (car process))))
                   (proced-log (current-buffer))
@@ -1875,7 +1875,7 @@ proced-renice
     (dolist (process process-alist)
       (with-temp-buffer
         (condition-case nil
-            (unless (zerop (call-process
+            (unless (zerop (process-file
                             proced-renice-command nil t nil
                             priority (number-to-string (car process))))
               (proced-log (current-buffer))



^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2022-03-30 15:34 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-25  0:09 process-file instead of call-process in proced.el? Filipp Gunbin
2022-03-25  6:54 ` Eli Zaretskii
2022-03-25 10:24   ` Filipp Gunbin
2022-03-25 10:31     ` Eli Zaretskii
2022-03-25 11:46       ` Michael Albinus
2022-03-25 12:12         ` Eli Zaretskii
2022-03-25 12:29           ` Filipp Gunbin
2022-03-25 13:34             ` Roland Winkler
2022-03-25 13:58             ` Michael Albinus
2022-03-25 14:26               ` Filipp Gunbin
2022-03-25 14:29                 ` Michael Albinus
2022-03-25 15:40                   ` Filipp Gunbin
2022-03-25 15:43                     ` Michael Albinus
2022-03-26 16:49 ` Michael Albinus
2022-03-26 17:37   ` Roland Winkler
2022-03-26 18:31     ` Michael Albinus
2022-03-26 18:49       ` Roland Winkler
2022-03-27  7:28         ` Michael Albinus
2022-03-27 14:08           ` Michael Albinus
2022-03-28  2:57             ` Roland Winkler
2022-03-28  7:41               ` Michael Albinus
2022-03-28 14:34                 ` Roland Winkler
2022-03-28 14:53             ` Filipp Gunbin
2022-03-28 15:40               ` Michael Albinus
2022-03-28 16:11                 ` Filipp Gunbin
2022-03-28 16:39                   ` Michael Albinus
2022-03-28 19:42                     ` Filipp Gunbin
2022-03-30 11:20                       ` Michael Albinus
2022-03-30 15:34                         ` Filipp Gunbin
2022-03-28 17:08             ` Jim Porter

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).