commit 8b5da9306a8a2be2449315b80dd43d4bf0ea21f5
parent 729199ea313b92b560483c4cf45f12de56abf15a
Author: Tomas Hlavaty <tom@logand.com>
Date: Thu, 13 Jan 2011 22:23:09 +0100
all wget in one function
Diffstat:
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/w3mail.c b/w3mail.c
@@ -77,20 +77,19 @@ static void fpr(FILE *out, ...) {
va_end(v);
}
-// http://www.gnu.org/software/wget/manual/html_node/Exit-Status.html
-static char *wgetmsg[] = {
- "No problems occurred",
- "Generic error code",
- "Parse error, e.g. when parsing command-line options, .wgetrc or .netrc",
- "File I/O error",
- "Network failure",
- "SSL verification failure",
- "Username/password authentication failure",
- "Protocol errors",
- "Server issued an error response"
-};
-
static void wget(char *url, char *fname) {
+ // http://www.gnu.org/software/wget/manual/html_node/Exit-Status.html
+ static char *wgetmsg[] = {
+ "No problems occurred",
+ "Generic error code",
+ "Parse error, e.g. when parsing command-line options, .wgetrc or .netrc",
+ "File I/O error",
+ "Network failure",
+ "SSL verification failure",
+ "Username/password authentication failure",
+ "Protocol errors",
+ "Server issued an error response"
+ };
int pid = fork();
if(pid < 0) die(pid, "wget(): fork failed");
else if(pid == 0) execlp("wget", "wget", "-q", "-O", fname, "--", url, NULL);