libxbps: added xbps_fetch_error_string(), that returns libfetch
fetchLastErrString. Hook xbps-fetch to the tree and use the new function to print errors. --HG-- extra : convert_revision : xtraeme%40gmail.com-20091030021303-6wu9sri5o8kgvfwl
This commit is contained in:
@ -5,10 +5,18 @@
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int rv = 0;
|
||||
|
||||
if (argc != 2) {
|
||||
printf("Usage: xbps-fetch [options] URL\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
return xbps_fetch_file(argv[1], ".");
|
||||
rv = xbps_fetch_file(argv[1], ".");
|
||||
if (rv != 0) {
|
||||
printf("xbps-fetch: couldn't download %s!\n", argv[1]);
|
||||
printf("xbps-fetch: %s\n", xbps_fetch_error_string());
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
Reference in New Issue
Block a user