Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/dload.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/dload.c')
-rw-r--r--lib/libalpm/dload.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index c11148d1..09f716f5 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -29,16 +29,13 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
-#include <limits.h>
-/* the following two are needed on BSD for libfetch */
-#if defined(HAVE_SYS_SYSLIMITS_H)
-#include <sys/syslimits.h> /* PATH_MAX */
-#endif
+/* the following two are needed for FreeBSD's libfetch */
+#include <limits.h> /* PATH_MAX */
#if defined(HAVE_SYS_PARAM_H)
#include <sys/param.h> /* MAXHOSTNAMELEN */
#endif
-#if defined(INTERNAL_DOWNLOAD)
+#ifdef HAVE_LIBFETCH
#include <fetch.h>
#endif
@@ -58,7 +55,7 @@ static char *get_filename(const char *url) {
return(filename);
}
-#if defined(INTERNAL_DOWNLOAD)
+#ifdef HAVE_LIBFETCH
static char *get_destfile(const char *path, const char *filename) {
char *destfile;
/* len = localpath len + filename len + null */
@@ -89,7 +86,7 @@ static const char *gethost(struct url *fileurl)
}
int dload_interrupted;
-static RETSIGTYPE inthandler(int signum)
+static void inthandler(int signum)
{
dload_interrupted = 1;
}
@@ -251,7 +248,7 @@ static int download_internal(const char *url, const char *localpath,
check_stop();
size_t nwritten = 0;
nwritten = fwrite(buffer, 1, nread, localf);
- if((nwritten != nread) || ferror(localf)) {
+ if((nwritten != (size_t)nread) || ferror(localf)) {
pm_errno = PM_ERR_RETRIEVE;
_alpm_log(PM_LOG_ERROR, _("error writing to file '%s': %s\n"),
tempfile, strerror(errno));
@@ -338,7 +335,7 @@ cleanup:
static int download(const char *url, const char *localpath,
int force) {
if(handle->fetchcb == NULL) {
-#if defined(INTERNAL_DOWNLOAD)
+#ifdef HAVE_LIBFETCH
return(download_internal(url, localpath, force));
#else
RET_ERR(PM_ERR_EXTERNAL_DOWNLOAD, -1);