diff options
author | Leah Neukirchen <leah@vuxu.org> | 2017-08-31 16:54:59 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2017-08-31 16:54:59 +0200 |
commit | 2140e10706600dc24e38f3585b058784b905ae88 (patch) | |
tree | f045c464ce7709421723fc8ab2015581c4ad5cc4 /xe.c | |
parent | f22f3f1f2a1ed69492dcb8bddbb06f8d6dd75ac5 (diff) | |
download | xe-2140e10706600dc24e38f3585b058784b905ae88.tar.gz xe-2140e10706600dc24e38f3585b058784b905ae88.tar.xz xe-2140e10706600dc24e38f3585b058784b905ae88.zip |
style
Diffstat (limited to 'xe.c')
-rw-r--r-- | xe.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xe.c b/xe.c index bd08a68..377dd77 100644 --- a/xe.c +++ b/xe.c @@ -11,13 +11,13 @@ #include <sys/types.h> #include <sys/wait.h> -#include <limits.h> #include <errno.h> +#include <fcntl.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <fcntl.h> static char delim = '\n'; static char default_replace[] = "{}"; @@ -91,7 +91,7 @@ mywait() if (errno == ECHILD) return 0; // no other error possible? - } + } int i; for (i = 0; i < maxjobs; i++) @@ -265,7 +265,7 @@ run() if (lpid == 0) { // in line-logging child char *line = 0; size_t linelen = 0; - + close(0); close(pipefd[1]); FILE *input = fdopen(pipefd[0], "r"); @@ -372,7 +372,7 @@ main(int argc, char *argv[], char *envp[]) argmax = sysconf(_SC_ARG_MAX); while (*envp) // subtract size of environment - argmax -= strlen(*envp++) + 1 + sizeof(*envp); + argmax -= strlen(*envp++) + 1 + sizeof *envp; argmax -= 4 * 1024; // subtract 4k for safety if (argmax > 128 * 1024) // upper bound argmax = 128 * 1024; @@ -382,7 +382,7 @@ main(int argc, char *argv[], char *envp[]) traceout = stdout; while ((c = getopt(argc, argv, "+0A:FI:LN:Raf:j:ns:v")) != -1) - switch(c) { + switch (c) { case '0': delim = '\0'; break; case 'A': argsep = optarg; Aflag++; break; case 'I': replace = optarg; break; @@ -397,7 +397,7 @@ main(int argc, char *argv[], char *envp[]) case 's': sflag = optarg; break; case 'v': vflag++; traceout = stderr; break; default: - fprintf(stderr, + fprintf(stderr, "Usage: %s [-0FLRnv] [-I arg] [-N maxargs] [-j maxjobs] COMMAND...\n" " | -f ARGFILE COMMAND...\n" " | -s SHELLSCRIPT\n" |