X-Git-Url: https://git.distorted.org.uk/~mdw/adns/blobdiff_plain/ab397b6e821f0c29ad8237e3f538d750b966d215..2b4bbcacf214a83f0dfb4331e116af3563266815:/client/adnslogres.c diff --git a/client/adnslogres.c b/client/adnslogres.c index d15f7b3..9c5216e 100644 --- a/client/adnslogres.c +++ b/client/adnslogres.c @@ -3,7 +3,9 @@ * - a replacement for the Apache logresolve program using adns */ /* - * This file is Copyright (C) 1999 Tony Finch + * This file is + * Copyright (C) 1999 Tony Finch + * Copyright (C) 1999 Ian Jackson * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,11 +19,14 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * This version was originally supplied by Tony Finch, but has been + * modified by Ian Jackson as it was incorporated into adns. */ static const char * const cvsid = - "$Id: adnslogres.c,v 1.1 1999/08/15 15:30:32 ian Exp $"; + "$Id: adnslogres.c,v 1.2 1999/08/15 16:15:52 ian Exp $"; #include #include @@ -87,7 +92,7 @@ static void printline(char *start, char *addr, char *rest, char *domain) { printf("%.*s%s%s", addr - start, start, domain, rest); else fputs(start, stdout); - /* XXX: error checking */ + if (ferror(stdout)) aargh("write output"); } typedef struct logline { @@ -159,9 +164,9 @@ static void proclog(void) { adns_finish(adns); } -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { progname= *argv; proclog(); + if (fclose(stdout)) aargh("finish writing output"); return 0; }