[hackers] [scc] [driver] adapt spawn() style to the other functions || Quentin Rameau

From: <git_AT_suckless.org>
Date: Tue, 7 Jun 2016 14:30:12 +0200 (CEST)

commit dddda2173652528dda59bef3f5a2e3ce408d0606
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Tue Jun 7 14:24:48 2016 +0200
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Tue Jun 7 14:30:03 2016 +0200

    [driver] adapt spawn() style to the other functions

diff --git a/driver/posix/scc.c b/driver/posix/scc.c
index a4ce04d..d6cc90e 100644
--- a/driver/posix/scc.c
+++ b/driver/posix/scc.c
_AT_@ -206,27 +206,27 @@ settool(int tool, char *infile, int nexttool)
 }
 
 static void
-spawn(int t)
+spawn(int tool)
 {
- Tool *tool = tools[t];
+ Tool *t = tools[tool];
 
- switch (tool->pid = fork()) {
+ switch (t->pid = fork()) {
         case -1:
- die("scc: %s: %s", tool->bin, strerror(errno));
+ die("scc: %s: %s", t->bin, strerror(errno));
         case 0:
- if (tool->out)
- dup2(tool->out, 1);
- if (tool->in)
- dup2(tool->in, 0);
- execvp(tool->cmd, tool->args);
- fprintf(stderr, "scc: execp %s: %s\n",
- tool->cmd, strerror(errno));
+ if (t->out)
+ dup2(t->out, 1);
+ if (t->in)
+ dup2(t->in, 0);
+ execvp(t->cmd, t->args);
+ fprintf(stderr, "scc: execvp %s: %s\n",
+ t->cmd, strerror(errno));
                 _exit(1);
         default:
- if (tool->in)
- close(tool->in);
- if (tool->out)
- close(tool->out);
+ if (t->in)
+ close(t->in);
+ if (t->out)
+ close(t->out);
                 break;
         }
 }
Received on Tue Jun 07 2016 - 14:30:12 CEST

This archive was generated by hypermail 2.3.0 : Tue Jun 07 2016 - 14:36:34 CEST