From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.org!.POSTED!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.bugs
Subject: bug#30031: [PATCH] Inherit query-on-exit flag to stderr process
(Bug#30031)
Date: Mon, 8 Jan 2018 21:53:34 +0100
Message-ID: <20180108205334.211232-1-phst__5015.63342190838$1515444748$gmane$org@google.com>
References:
NNTP-Posting-Host: blaine.gmane.org
X-Trace: blaine.gmane.org 1515444748 5625 195.159.176.226 (8 Jan 2018 20:52:28 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 8 Jan 2018 20:52:28 +0000 (UTC)
Cc: Philipp Stephani
To: emacs-devel@gnu.org, 30031@debbugs.gnu.org
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 08 21:52:23 2018
Return-path:
Envelope-to: geb-bug-gnu-emacs@m.gmane.org
Original-Received: from lists.gnu.org ([208.118.235.17])
by blaine.gmane.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1eYeOy-0000Ul-9A
for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Jan 2018 21:52:12 +0100
Original-Received: from localhost ([::1]:58256 helo=lists.gnu.org)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from )
id 1eYeQx-0006CH-LP
for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Jan 2018 15:54:15 -0500
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53216)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1eYeQp-0006Ag-4g
for bug-gnu-emacs@gnu.org; Mon, 08 Jan 2018 15:54:08 -0500
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1eYeQl-0005La-1M
for bug-gnu-emacs@gnu.org; Mon, 08 Jan 2018 15:54:07 -0500
Original-Received: from debbugs.gnu.org ([208.118.235.43]:33098)
by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
(Exim 4.71) (envelope-from )
id 1eYeQk-0005LJ-TI
for bug-gnu-emacs@gnu.org; Mon, 08 Jan 2018 15:54:02 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
(envelope-from ) id 1eYeQk-0007i5-GW
for bug-gnu-emacs@gnu.org; Mon, 08 Jan 2018 15:54:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Philipp Stephani
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Mon, 08 Jan 2018 20:54:02 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 30031
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
Original-Received: via spool by 30031-submit@debbugs.gnu.org id=B30031.151544483229620
(code B ref 30031); Mon, 08 Jan 2018 20:54:02 +0000
Original-Received: (at 30031) by debbugs.gnu.org; 8 Jan 2018 20:53:52 +0000
Original-Received: from localhost ([127.0.0.1]:41779 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1eYeQZ-0007hg-N7
for submit@debbugs.gnu.org; Mon, 08 Jan 2018 15:53:51 -0500
Original-Received: from mail-wr0-f174.google.com ([209.85.128.174]:46424)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1eYeQY-0007hS-24
for 30031@debbugs.gnu.org; Mon, 08 Jan 2018 15:53:50 -0500
Original-Received: by mail-wr0-f174.google.com with SMTP id g21so6303952wrb.13
for <30031@debbugs.gnu.org>; Mon, 08 Jan 2018 12:53:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=from:to:cc:subject:date:message-id:in-reply-to:references;
bh=J8DuIjA/mTa7JXoVMvN1OK7TzYPuKzMheYo0EWn3pYQ=;
b=JkJBUSCvQnjzfIcNkKkhANEIapw758eD/HaCZvvEHRtcYud490hgDrwWwsnwOfNkN0
zA9e6zbJxU8ixhWzj86V2OVBSx/J8W0t5RVslgRdmxS7QWIemO6rsd2F1e+kZnl/arjd
UcywnycVYQZsJnuXogBRtA1oCzK2wlSIul6LCL7hdG7Ea39NgSJxCeIvDwEgG4TecSUJ
pdxdGE9tyr7Gp3m7Picx2XLtag7+hU7/h8NSk4hvn2kVn0cuGN5YqrWaT8f+k1k1EPQn
f96HNllodSl7mG62WzRP/SBfcPBwLN4onTLZ1Y/kgJmafHJI1O2O1FbD/NTrcoLNdC2h
p5ZQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
:references;
bh=J8DuIjA/mTa7JXoVMvN1OK7TzYPuKzMheYo0EWn3pYQ=;
b=QSX9jiHvU2wwRzUkPfI+J0fdLmXYz7VK1qNzxliKm30Ja3/hEui+sbcxHs93QEV5/v
d3z23IWfdQ8Or5CS7ld6egkDZO/6bkEI8DXbeN6QswLXWhbRNhHKH/gz+HRvksJw4kig
z8s3T2YUJERdPqRh7Cl+JcW40enGsXGJ9e0ys84E9QFok6eNcqYbkGuDhozOATLTsoXo
gAHsCCpn/8HUiNPM68yjs/9YTXpGasgufmL0MqSl+EGC3HeFJGLmvCc/X14lND83rLLO
7jZCL2+qYXfoo4WhFFYqZuvA9dyTMY8C6Z/VQGr0OPJrxUs6Ljp08MUDuuzB5Tw3vGL1
DcMA==
X-Gm-Message-State: AKGB3mJ2ngNfeTde5LAFr6KSNj+b0mzBQRGjptA8wET8nS61IfTX5RjU
5Jtav6NDIPw+2fClf6Cv4EA=
X-Google-Smtp-Source: ACJfBotc+bdsdizhPzXS+fZtPfokIJcFhaf744CLMiYPqcJWPg7Iy8cF+V60aZcqEBcIXbebBxeFDQ==
X-Received: by 10.223.131.70 with SMTP id 64mr12133308wrd.65.1515444824066;
Mon, 08 Jan 2018 12:53:44 -0800 (PST)
Original-Received: from a.muc.corp.google.com ([2a00:79e0:15:4:bfda:710c:4a38:a674])
by smtp.gmail.com with ESMTPSA id
h76sm15807482wmd.2.2018.01.08.12.53.43
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Mon, 08 Jan 2018 12:53:43 -0800 (PST)
X-Google-Original-From: Philipp Stephani
X-Mailer: git-send-email 2.16.0.rc0.223.g4a4ac83678-goog
In-Reply-To:
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.43
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
the Swiss army knife of text editors"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org
Original-Sender: "bug-gnu-emacs"
Xref: news.gmane.org gmane.emacs.bugs:141909
Archived-At:
* src/process.c (Fmake_process): Have the pipe process honor the
parent's query-on-exit flag.
* test/src/process-tests.el (make-process/noquery-stderr): New test.
---
src/process.c | 8 ++++++--
test/src/process-tests.el | 19 +++++++++++++++++++
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/src/process.c b/src/process.c
index d4440e472d..e6465e2347 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1686,6 +1686,8 @@ usage: (make-process &rest ARGS) */)
if (!NILP (program))
CHECK_STRING (program);
+ bool query_on_exit = NILP (Fplist_get (contact, QCnoquery));
+
stderrproc = Qnil;
xstderr = Fplist_get (contact, QCstderr);
if (PROCESSP (xstderr))
@@ -1701,7 +1703,9 @@ usage: (make-process &rest ARGS) */)
QCname,
concat2 (name, build_string (" stderr")),
QCbuffer,
- Fget_buffer_create (xstderr));
+ Fget_buffer_create (xstderr),
+ QCnoquery,
+ query_on_exit ? Qnil : Qt);
}
proc = make_process (name);
@@ -1715,7 +1719,7 @@ usage: (make-process &rest ARGS) */)
pset_filter (XPROCESS (proc), Fplist_get (contact, QCfilter));
pset_command (XPROCESS (proc), Fcopy_sequence (command));
- if (tem = Fplist_get (contact, QCnoquery), !NILP (tem))
+ if (!query_on_exit)
XPROCESS (proc)->kill_without_query = 1;
if (tem = Fplist_get (contact, QCstop), !NILP (tem))
pset_command (XPROCESS (proc), Qt);
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index 34309a5817..7d35560229 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -162,5 +162,24 @@ process-test-sentinel-wait-function-working-p
(error nil))))
(should (equal path samepath))))
+(ert-deftest make-process/noquery-stderr ()
+ "Checks that Bug#30031 is fixed."
+ (skip-unless (executable-find "sleep"))
+ (with-temp-buffer
+ (let* ((previous-processes (process-list))
+ (process (make-process :name "sleep"
+ :command '("sleep" "1h")
+ :noquery t
+ :connection-type 'pipe
+ :stderr (current-buffer))))
+ (unwind-protect
+ (let ((new-processes (cl-set-difference (process-list)
+ previous-processes
+ :test #'eq)))
+ (should new-processes)
+ (dolist (process new-processes)
+ (should-not (process-query-on-exit-flag process))))
+ (kill-process process)))))
+
(provide 'process-tests)
;; process-tests.el ends here.
--
2.16.0.rc0.223.g4a4ac83678-goog