all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#73905: guix shell changes default sigaction for SIGPIPE
@ 2024-10-20 11:25 Tomas Volf
  2024-10-20 14:43 ` bug#73905: [PATCH] environment: Restore action " Tomas Volf
  0 siblings, 1 reply; 2+ messages in thread
From: Tomas Volf @ 2024-10-20 11:25 UTC (permalink / raw)
  To: 73905

[-- Attachment #1: Type: text/plain, Size: 540 bytes --]


Guix shell changes the default handler for SIGPIPE for the command it
runs.  Can be demonstrated using the following:

--8<---------------cut here---------------start------------->8---
$ guix shell guile -- guile -c '(pk (sigaction SIGPIPE))'

;;; ((1 . 0))
$ guile -c '(pk (sigaction SIGPIPE))'

;;; ((0 . 0))
--8<---------------cut here---------------end--------------->8---

Have a nice day,
Tomas Volf

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]

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

* bug#73905: [PATCH] environment: Restore action for SIGPIPE.
  2024-10-20 11:25 bug#73905: guix shell changes default sigaction for SIGPIPE Tomas Volf
@ 2024-10-20 14:43 ` Tomas Volf
  0 siblings, 0 replies; 2+ messages in thread
From: Tomas Volf @ 2024-10-20 14:43 UTC (permalink / raw)
  To: 73905
  Cc: Tomas Volf, Christopher Baines, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Simon Tournier,
	Tobias Geerinckx-Rice

Code in `ui.scm' in `initialize-guix' procedure changes the handling of
SIGPIPE to SIG_IGN.  So restore the handling to SIG_DFL so that process
executed will have the usual action.  Technically we should record what the
handling was, and restore it to the previous value, but that would be much
more invasive change.

Always setting it to SIG_DFL is at least less surprising than always setting
to SIG_IGN.

* guix/scripts/environment.scm (launch-environment): Restore default action
for SIGPIPE.

Change-Id: Ifabae1d3e71aa44e63078cea5bd3824b8f61ba14
---
 guix/scripts/environment.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index a219b2ac89..79eb7f3f30 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -499,6 +499,8 @@ (define* (launch-environment command profile manifest
   ;; Properly handle SIGINT, so pressing C-c in an interactive terminal
   ;; application works.
   (sigaction SIGINT SIG_DFL)
+  ;; Restore original action for SIGPIPE.
+  (sigaction SIGPIPE SIG_DFL)
   (load-profile profile manifest
                 #:pure? pure? #:white-list-regexps white-list)
 
-- 
2.46.0





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

end of thread, other threads:[~2024-10-20 15:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-20 11:25 bug#73905: guix shell changes default sigaction for SIGPIPE Tomas Volf
2024-10-20 14:43 ` bug#73905: [PATCH] environment: Restore action " Tomas Volf

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.