Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: The request of words matter updated
- X-seq: zsh-workers 50672
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Cc: Xiao Ling XL Chen <chenxlxl@xxxxxxxxxx>, Kui K Zhang <kzzhang@xxxxxxxxxx>
- Subject: Re: The request of words matter updated
- Date: Tue, 27 Sep 2022 09:44:14 +0100 (BST)
- Archived-at: <https://zsh.org/workers/50672>
- Importance: Normal
- In-reply-to: <CAH+w=7Z+PUJ9Xq64aY3ZXP=nSvRVcu5sG25yOPn2QrcW5RVUBQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <DM6PR15MB4139085983BB9582B84DDB3DF04D9@DM6PR15MB4139.namprd15.prod.outlook.com> <CAH+w=7bM-Muz=pTOQzM2ysVvjnYqZHS5UvvMpM7JFojWuGVx0w@mail.gmail.com> <6e0e440b-8e26-4a15-8f69-7b393aa6ff13@app.fastmail.com> <CAH+w=7Z+PUJ9Xq64aY3ZXP=nSvRVcu5sG25yOPn2QrcW5RVUBQ@mail.gmail.com>
> On 27/09/2022 05:22 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
>
> On Mon, Sep 26, 2022 at 8:18 PM Lawrence Velázquez <larryv@xxxxxxx> wrote:
> >
> > Illumos uses "manager" and "subsidiary"
> > AIX uses "controller" and "worker"
>
> Well, that's no fun. It means there's no "term of art" we can adopt.
> On the other hand, I guess, it means we don't have to worry about
> confusing future programmers, because they'll already be confused.
My only comment is that if we pick something unique and do the job
properly this time, then any further update to fit in with standards
is a 30 second automatic replacement. So I don't think it's worth
agonising over.
> In this particular context I'd probably choose something like
> superior/inferior ... neither subsidiary nor worker really fits what
> that half of the PTY pair is doing, IMO. They sound like words chosen
> for a global search-and-replace over a codebase nobody was willing to
> actually read.
So e.g. zsuperior and zinferior would give us that ability (but you may
well be right superior and inferior are good enough --- replacing
master and slave didn't hit any clashes).
pws
diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c
index dfd2a2a7a..b9e3b4050 100644
--- a/Src/Modules/zpty.c
+++ b/Src/Modules/zpty.c
@@ -188,7 +188,7 @@ getptycmd(char *name)
#endif
static int
-get_pty(int master, int *retfd)
+get_pty(int zsuperior, int *retfd)
{
static char *name;
static int mfd, sfd;
@@ -196,7 +196,7 @@ get_pty(int master, int *retfd)
int ret;
#endif
- if (master) {
+ if (zsuperior) {
#ifdef HAVE_POSIX_OPENPT
if ((mfd = posix_openpt(O_RDWR|O_NOCTTY)) < 0)
#else
@@ -252,7 +252,7 @@ get_pty(int master, int *retfd)
#else /* No /dev/ptmx or no pt functions */
static int
-get_pty(int master, int *retfd)
+get_pty(int zsuperior, int *retfd)
{
#ifdef __linux
@@ -275,7 +275,7 @@ get_pty(int master, int *retfd)
static int mfd, sfd;
char *p1, *p2;
- if (master) {
+ if (zsuperior) {
strcpy(name, "/dev/ptyxx");
#if defined(__BEOS__) || defined(__HAIKU__)
name[7] = '/';
@@ -310,7 +310,7 @@ static int
newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
{
Ptycmd p;
- int master, slave, pid, oineval = ineval, ret;
+ int zsuperior, zinferior, pid, oineval = ineval, ret;
char *oscriptname = scriptname, syncch;
Eprog prog;
@@ -327,7 +327,7 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
return 1;
}
- if (get_pty(1, &master)) {
+ if (get_pty(1, &zsuperior)) {
zwarnnam(nam, "can't open pseudo terminal: %e", errno);
scriptname = oscriptname;
ineval = oineval;
@@ -335,7 +335,7 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
}
if ((pid = fork()) == -1) {
zwarnnam(nam, "can't create pty command %s: %e", pname, errno);
- close(master);
+ close(zsuperior);
scriptname = oscriptname;
ineval = oineval;
return 1;
@@ -360,9 +360,9 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
}
#endif
- if (get_pty(0, &slave))
+ if (get_pty(0, &zinferior))
exit(1);
- SHTTY = slave;
+ SHTTY = zinferior;
attachtty(mypid);
#ifdef TIOCGWINSZ
/* Set the window size before associating with the terminal *
@@ -370,10 +370,10 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
if (interact) {
struct ttyinfo info;
- if (ioctl(slave, TIOCGWINSZ, (char *) &info.winsize) == 0) {
+ if (ioctl(zinferior, TIOCGWINSZ, (char *) &info.winsize) == 0) {
info.winsize.ws_row = zterm_lines;
info.winsize.ws_col = zterm_columns;
- ioctl(slave, TIOCSWINSZ, (char *) &info.winsize);
+ ioctl(zinferior, TIOCSWINSZ, (char *) &info.winsize);
}
}
#endif /* TIOCGWINSZ */
@@ -381,7 +381,7 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
if (!echo) {
struct ttyinfo info;
- if (!ptygettyinfo(slave, &info)) {
+ if (!ptygettyinfo(zinferior, &info)) {
#ifdef HAVE_TERMIOS_H
info.tio.c_lflag &= ~ECHO;
#else
@@ -391,25 +391,25 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
info.tio.lmodes &= ~ECHO; /**** dunno if this is right */
#endif
#endif
- ptysettyinfo(slave, &info);
+ ptysettyinfo(zinferior, &info);
}
}
#ifdef TIOCSCTTY
- ioctl(slave, TIOCSCTTY, 0);
+ ioctl(zinferior, TIOCSCTTY, 0);
#endif
close(0);
close(1);
close(2);
- dup2(slave, 0);
- dup2(slave, 1);
- dup2(slave, 2);
+ dup2(zinferior, 0);
+ dup2(zinferior, 1);
+ dup2(zinferior, 2);
closem(FDT_UNUSED, 0);
- close(slave);
- close(master);
+ close(zinferior);
+ close(zsuperior);
close(coprocin);
close(coprocout);
init_io(NULL);
@@ -436,22 +436,22 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
zexit(lastval, ZEXIT_NORMAL);
}
#ifndef USE_CYGWIN_FIX
- master = movefd(master);
- if (master == -1) {
- zerrnam(nam, "cannot duplicate fd %d: %e", master, errno);
+ zsuperior = movefd(zsuperior);
+ if (zsuperior == -1) {
+ zerrnam(nam, "cannot duplicate fd %d: %e", zsuperior, errno);
scriptname = oscriptname;
ineval = oineval;
return 1;
}
#else
- addmodulefd(master, FDT_INTERNAL);
+ addmodulefd(zsuperior, FDT_INTERNAL);
#endif
p = (Ptycmd) zalloc(sizeof(*p));
p->name = ztrdup(pname);
p->args = zarrdup(args);
- p->fd = master;
+ p->fd = zsuperior;
p->pid = pid;
p->echo = echo;
p->nblock = nblock;
@@ -464,13 +464,13 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
ptycmds = p;
if (nblock)
- ptynonblock(master);
+ ptynonblock(zsuperior);
scriptname = oscriptname;
ineval = oineval;
do {
- ret = read(master, &syncch, 1);
+ ret = read(zsuperior, &syncch, 1);
} while (ret != 1 && (
#ifdef EWOULDBLOCK
errno == EWOULDBLOCK ||
@@ -481,7 +481,7 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
#endif
errno == EINTR));
- setiparam_no_convert("REPLY", (zlong)master);
+ setiparam_no_convert("REPLY", (zlong)zsuperior);
return 0;
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author