40b3cc4018b542f5cc7637992f4b85632f626306 galt Thu Jun 24 21:23:46 2010 -0700 paraFetch utility should exit 1 on failure to let caller know diff --git src/utils/paraFetch/paraFetch.c src/utils/paraFetch/paraFetch.c index de518df..1443f81 100644 --- src/utils/paraFetch/paraFetch.c +++ src/utils/paraFetch/paraFetch.c @@ -1,40 +1,39 @@ /* paraFetch - fetch URL with multiple parallel connections. */ #include "common.h" #include "options.h" #include "dystring.h" #include "obscure.h" #include "net.h" void usage() /* Explain usage and exit */ { errAbort( "paraFetch - try to fetch url with multiple connections\n" "usage:\n" " paraFetch N URL outPath\n" " where N is the number of connections to use\n" ); } static struct optionSpec options[] = { {NULL, 0}, }; -void paraFetch(int numConnections, char *url, char *outPath) +boolean paraFetch(int numConnections, char *url, char *outPath) /* Fetch given URL, send to stdout. */ { -parallelFetch(url, numConnections, outPath); +return parallelFetch(url, numConnections, outPath); } - - int main(int argc, char *argv[]) /* Process command line. */ { optionInit(&argc, argv, options); if (argc != 4) usage(); -paraFetch(atoi(argv[1]), argv[2], argv[3]); +if (!paraFetch(atoi(argv[1]), argv[2], argv[3])) + exit(1); return 0; }