From d6089cc8b17ed7d33850bb9075a9c6771fe120d6 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 15 Apr 2005 10:40:01 +0000 Subject: 21143: more care about special file descriptors --- Src/Modules/socket.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Src/Modules/socket.c') diff --git a/Src/Modules/socket.c b/Src/Modules/socket.c index 3a2c590a1..2f95a84d5 100644 --- a/Src/Modules/socket.c +++ b/Src/Modules/socket.c @@ -78,6 +78,11 @@ bin_zsocket(char *nam, char **args, Options ops, UNUSED(int func)) OPT_ARG(ops, 'd'), 0); return 1; } + if (targetfd <= max_zsh_fd && fdtable[targetfd] != FDT_UNUSED) { + zwarnnam(nam, "file descriptor %d is in use by the shell", + NULL, targetfd); + return 1; + } } if (OPT_ISSET(ops,'l')) { -- cgit 1.4.1