From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18704 invoked by alias); 11 Sep 2017 03:09:36 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41666 Received: (qmail 20339 invoked by uid 1010); 11 Sep 2017 03:09:36 -0000 X-Qmail-Scanner-Diagnostics: from hermes.ghelew.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(46.101.244.21):SA:0(-1.9/5.0):. Processed in 2.31847 secs); 11 Sep 2017 03:09:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: tlux@ghelew.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Sender: tlux@ghelew.net From: Thierry Ghelew To: zsh-workers@zsh.org Subject: [PATCH] add the full range of OpenBSD ptys Date: Sun, 10 Sep 2017 23:09:17 -0400 Message-Id: <20170911030917.9300-1-tlux@ghelew.net> X-PGP-Key: http://keys.gnupg.net/pks/lookup?op=get&search=0x2C50CBCCF344ABF0 When more than 15 terminals (tty**) are opened with the default setting of OpenBSD, zpty module throws an error like: **** (zpty):zpty:2: can't open pseudo terminal: device not configured **** This was caused mainly by the limited list of char1[] and char2[] which didn't represent the full range of OpenBSD tty's names. The above is highlighted when zpty is used by the shell prompt[1] . Feedback are always appreciated! Regards, Thierry [1] https://github.com/sindresorhus/pure --- Src/Modules/zpty.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c index 3c1bef58f..1c93a1d02 100644 --- a/Src/Modules/zpty.c +++ b/Src/Modules/zpty.c @@ -254,7 +254,12 @@ get_pty(int master, int *retfd) #elif defined(__FreeBSD__) || defined(__DragonFly__) static char char1[] = "pqrsPQRS"; static char char2[] = "0123456789abcdefghijklmnopqrstuv"; -#else /* __FreeBSD__ || __DragonFly__ */ +#elif defined(__OpenBSD__) + static char char1[] = "pqrstuvwxyzPQRST"; + static char char2[] = "0123456789" + "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; +#else /* __FreeBSD__ || __DragonFly__ || __OpenBSD*/ static char char1[] = "pqrstuvwxyzPQRST"; static char char2[] = "0123456789abcdef"; #endif -- 2.12.2