diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-06-09 19:14:27 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-06-09 19:14:27 +0000 |
| commit | 3adc74c768226112b373d0bcacee73521b0aed2a (patch) | |
| tree | 16a54540a7fb71a7c91fd866ad2437410acbf587 /contrib | |
| parent | 16e7cc26b92bfce95d9235055175bca313845189 (diff) | |
| parent | 019098cfd4f55d00b6c91a8a36d49811f2705a57 (diff) | |
Notes
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/dtc/checks.c | 4 | ||||
| -rw-r--r-- | contrib/mdocml/read.c | 27 | ||||
| -rw-r--r-- | contrib/top/top.local.hs (renamed from contrib/top/top.local.H) | 0 | ||||
| -rw-r--r-- | contrib/top/top.xs (renamed from contrib/top/top.X) | 0 |
4 files changed, 26 insertions, 5 deletions
diff --git a/contrib/dtc/checks.c b/contrib/dtc/checks.c index 11a40861e401e..f704694775548 100644 --- a/contrib/dtc/checks.c +++ b/contrib/dtc/checks.c @@ -624,11 +624,11 @@ static void check_avoid_default_addr_size(struct check *c, struct node *dt, if (!reg && !ranges) return; - if ((node->parent->addr_cells == -1)) + if (node->parent->addr_cells == -1) FAIL(c, "Relying on default #address-cells value for %s", node->fullpath); - if ((node->parent->size_cells == -1)) + if (node->parent->size_cells == -1) FAIL(c, "Relying on default #size-cells value for %s", node->fullpath); } diff --git a/contrib/mdocml/read.c b/contrib/mdocml/read.c index 471d415019f5e..a34c9ffdedca4 100644 --- a/contrib/mdocml/read.c +++ b/contrib/mdocml/read.c @@ -28,6 +28,7 @@ #include <assert.h> #include <ctype.h> #include <errno.h> +#include <err.h> #include <fcntl.h> #include <stdarg.h> #include <stdint.h> @@ -35,6 +36,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <zlib.h> #include "mandoc.h" #include "mandoc_aux.h" @@ -792,6 +794,27 @@ mparse_readfd(struct mparse *curp, int fd, const char *file) return(curp->file_status); } +/* + * hack to avoid depending on gnuzip(1) waiting for upstream proper + * support + */ +static int +gunzip(const char *file) +{ + gzFile gz; + char buf[8192]; + int r; + + gz = gzopen(file, "r"); + if (gz == NULL) + err(EXIT_FAILURE, "cannot open %s", file); + + while ((r = gzread(gz, buf, sizeof(buf))) > 0) + fwrite(buf, 1, r, stdout); + + gzclose(gz); + return (EXIT_SUCCESS); +} enum mandoclevel mparse_open(struct mparse *curp, int *fd, const char *file) { @@ -846,9 +869,7 @@ mparse_open(struct mparse *curp, int *fd, const char *file) perror("dup"); exit((int)MANDOCLEVEL_SYSERR); } - execlp("gunzip", "gunzip", "-c", file, NULL); - perror("exec"); - exit((int)MANDOCLEVEL_SYSERR); + exit(gunzip(file)); default: close(pfd[1]); *fd = pfd[0]; diff --git a/contrib/top/top.local.H b/contrib/top/top.local.hs index 9eb7a64e532a7..9eb7a64e532a7 100644 --- a/contrib/top/top.local.H +++ b/contrib/top/top.local.hs diff --git a/contrib/top/top.X b/contrib/top/top.xs index 15cf2dcb51190..15cf2dcb51190 100644 --- a/contrib/top/top.X +++ b/contrib/top/top.xs |
