summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/error.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-04-19 19:36:18 +0200
committerDan McGee <dan@archlinux.org>2008-04-19 23:18:17 +0200
commit7a873a8f1284058c968c5d8026fbde7867913cb5 (patch)
treebcb53ded41e969fc17955cbc459d632a832415f0 /lib/libalpm/error.c
parent64e1dd64a4512a5faa34e6007e64314569593522 (diff)
downloadpacman-7a873a8f1284058c968c5d8026fbde7867913cb5.tar.gz
pacman-7a873a8f1284058c968c5d8026fbde7867913cb5.tar.xz
Give libalpm native support for both libdownload and libfetch
This should remove the need for any additional patching to run on platforms that have libfetch available but not libdownload. It isn't the prettiest, but we have kept our libdownload impact down to just a few files, so it can be easily done. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/error.c')
-rw-r--r--lib/libalpm/error.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c
index 30e9cf86..7c30cd09 100644
--- a/lib/libalpm/error.c
+++ b/lib/libalpm/error.c
@@ -19,8 +19,22 @@
#include "config.h"
-#if defined(INTERNAL_DOWNLOAD)
+/* TODO: needed for the libfetch stuff, unfortunately- we should kill it */
+#include <stdio.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
+#if defined(HAVE_SYS_PARAM_H)
+#include <sys/param.h> /* MAXHOSTNAMELEN */
+#endif
+
+#if defined(HAVE_LIBDOWNLOAD)
#include <download.h> /* downloadLastErrString */
+#elif defined(HAVE_LIBFETCH)
+#include <fetch.h> /* fetchLastErrString */
+#define downloadLastErrString fetchLastErrString
#endif
/* libalpm */
@@ -145,7 +159,7 @@ const char SYMEXPORT *alpm_strerror(int err)
return downloadLastErrString;
#else
/* obviously shouldn't get here... */
- return _("libdownload error");
+ return _("download library error");
#endif
case PM_ERR_EXTERNAL_DOWNLOAD:
return _("error invoking external downloader");