"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "catman.c" between
mdocml-1.14.1rc1.tar.gz and mdocml-1.14.1rc2.tar.gz

About: mdocml is a suite of tools compiling "-mdoc", the roff macro package of choice for BSD manual pages, and "-man", the predominant historical package for UNIX manuals. Hint: The installed binary name is "mandoc". Release candidate.

catman.c  (mdocml-1.14.1rc1):catman.c  (mdocml-1.14.1rc2)
/* $Id: catman.c,v 1.16 2017/02/08 16:11:40 schwarze Exp $ */ /* $Id: catman.c,v 1.21 2017/02/18 12:24:24 schwarze Exp $ */
/* /*
* Copyright (c) 2017 Michael Stapelberg <stapelberg@debian.org> * Copyright (c) 2017 Michael Stapelberg <stapelberg@debian.org>
* Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies. * copyright notice and this permission notice appear in all copies.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
skipping to change at line 47 skipping to change at line 47
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
int process_manpage(int, int, const char *); int process_manpage(int, int, const char *);
int process_tree(int, int); int process_tree(int, int);
void run_mandocd(int, const char *, const char *) void run_mandocd(int, const char *, const char *)
__attribute__((noreturn)); __attribute__((__noreturn__));
ssize_t sock_fd_write(int, int, int, int); ssize_t sock_fd_write(int, int, int, int);
void usage(void) __attribute__((noreturn)); void usage(void) __attribute__((__noreturn__));
void void
run_mandocd(int sockfd, const char *outtype, const char* defos) run_mandocd(int sockfd, const char *outtype, const char* defos)
{ {
char sockfdstr[10]; char sockfdstr[10];
if (snprintf(sockfdstr, sizeof(sockfdstr), "%d", sockfd) == -1) if (snprintf(sockfdstr, sizeof(sockfdstr), "%d", sockfd) == -1)
err(1, "snprintf"); err(1, "snprintf");
if (defos == NULL) if (defos == NULL)
execlp("mandocd", "mandocd", "-T", outtype, sockfdstr, NULL); execlp("mandocd", "mandocd", "-T", outtype,
sockfdstr, (char *)NULL);
else else
execlp("mandocd", "mandocd", "-T", outtype, execlp("mandocd", "mandocd", "-T", outtype,
"-I", defos, sockfdstr, NULL); "-I", defos, sockfdstr, (char *)NULL);
err(1, "exec"); err(1, "exec");
} }
ssize_t ssize_t
sock_fd_write(int fd, int fd0, int fd1, int fd2) sock_fd_write(int fd, int fd0, int fd1, int fd2)
{ {
const struct timespec timeout = { 0, 10000000 }; /* 0.01 s */ const struct timespec timeout = { 0, 10000000 }; /* 0.01 s */
struct msghdr msg; struct msghdr msg;
struct iovec iov; struct iovec iov;
union { union {
skipping to change at line 255 skipping to change at line 256
if (chdir(argv[0]) == -1) if (chdir(argv[0]) == -1)
err(1, "chdir(%s)", argv[0]); err(1, "chdir(%s)", argv[0]);
return process_tree(srv_fds[0], dstdir_fd) == -1 ? 1 : 0; return process_tree(srv_fds[0], dstdir_fd) == -1 ? 1 : 0;
} }
void void
usage(void) usage(void)
{ {
fprintf(stderr, "usage: catman [-I os=name] [-T output] " fprintf(stderr, "usage: %s [-I os=name] [-T output] "
"srcdir dstdir\n"); "srcdir dstdir\n", BINM_CATMAN);
exit(1); exit(1);
} }
 End of changes. 6 change blocks. 
7 lines changed or deleted 8 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS