zsh-workers
 help / color / mirror / code / Atom feed
* xtrace output sets ERRNO to 9 (EBADF)
@ 2022-12-09 14:10 Stephane Chazelas
  2022-12-10  2:57 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Stephane Chazelas @ 2022-12-09 14:10 UTC (permalink / raw)
  To: Zsh hackers list

$ ./Src/zsh -c 'set -o xtrace; ERRNO=0; :; echo "$ERRNO"'
+zsh:1> ERRNO=0
+zsh:1> :
+zsh:1> echo 9
9

Seems to be caused by a double-close. From strace:

dup(2)                                  = 3
fcntl(3, F_DUPFD, 10)                   = 12
close(3)                                = 0
fcntl(12, F_GETFL)                      = 0x1 (flags O_WRONLY)
newfstatat(12, "", {st_mode=S_IFIFO|0600, st_size=0, ...}, AT_EMPTY_PATH) = 0
brk(0x557861189000)                     = 0x557861189000
write(12, "+zsh:1> :\n", 10+zsh:1> :
)            = 10
close(12)                               = 0
brk(0x557861188000)                     = 0x557861188000
close(12)                               = -1 EBADF (Bad file descriptor)

(on Debian GNU/Linux amd64 with 5.9 or git HEAD).

-- 
Stephane


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

end of thread, other threads:[~2022-12-11 20:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09 14:10 xtrace output sets ERRNO to 9 (EBADF) Stephane Chazelas
2022-12-10  2:57 ` Bart Schaefer
2022-12-10 11:38   ` Daniel Shahaf
2022-12-11 18:35     ` Stephane Chazelas
2022-12-11 18:52       ` Bart Schaefer
2022-12-11 20:01         ` Stephane Chazelas

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).