9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: geoff@collyer.net
To: 9fans@collyer.net
Subject: [9fans] fix to /sys/src/ape/lib/bsd/pty.c
Date: Wed, 23 Jan 2002 17:25:35 -0800	[thread overview]
Message-ID: <20020124012541.6079219A65@mail.cse.psu.edu> (raw)

In the course of trying to get rk to build, I had to get the APE
_getpty() working again.  The new close and remove may be excessively
paranoid, but the changes from `3' to `O_RDWR' are essential.


: cpu; diff `{yesterday .} pty.c
66c66
< 	fd = _OPEN(fssrv, 3);
---
> 	fd = _OPEN(fssrv, O_RDWR);
67a68,77
> 		/*
> 		 * remove fssrv here, if it exists, to avoid a race
> 		 * between the loop in the default case below and the
> 		 * new ptyfs removing fssrv when it starts.
> 		 * we otherwise might be unlucky enough to open the old
> 		 * (hung channel) fssrv before ptyfs removes it and break
> 		 * out of the loop with an open fd to a hung channel?
> 		 */
> 		close(fd);
> 		remove(fssrv);
78c88
< 				fd = _OPEN(fssrv, 3);
---
> 				fd = _OPEN(fssrv, O_RDWR);
88c98,99
< 		_MOUNT(fd, "/dev", MAFTER, "");
---
> 		if (_MOUNT(fd, "/dev", MAFTER, "") < 0)
> 			;		/* buggery */


                 reply	other threads:[~2002-01-24  1:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020124012541.6079219A65@mail.cse.psu.edu \
    --to=geoff@collyer.net \
    --cc=9fans@collyer.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).