Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
xtrace output sets ERRNO to 9 (EBADF)
- X-seq: zsh-workers 51153
- From: Stephane Chazelas <stephane@xxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: xtrace output sets ERRNO to 9 (EBADF)
- Date: Fri, 9 Dec 2022 14:10:47 +0000
- Archived-at: <https://zsh.org/workers/51153>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxx>
$ ./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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author