diff options
author | Dan McGee <dan@archlinux.org> | 2008-06-01 21:47:31 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2008-06-04 15:38:47 -0500 |
commit | 0669c9bfac7aead01f1400444e691d542f7645c2 (patch) | |
tree | f5dc76963236bd50126d7b4e570969c14e066a03 /src/pacman/callback.h | |
parent | 62b4195c7680f9d404e175eb0869182efdd09ef2 (diff) |
Use correct C type for file sizes
We have been using unsigned long as a file size type for a while, which
works but isn't quite correct and could easily break. Worse was probably our
use of int in the download callback functions, which could be restrictive
for packages > 2GB in size.
Switch all file size variables to use off_t, which is the preferred type for
file sizes. Note that at least on Linux, all applications compiled against
libalpm must now be sure to use large file support, where _FILE_OFFSET_BITS
is defined to be 64 or there will be some weird issues that crop up.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/callback.h')
-rw-r--r-- | src/pacman/callback.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pacman/callback.h b/src/pacman/callback.h index 39d59d8b..28d396e8 100644 --- a/src/pacman/callback.h +++ b/src/pacman/callback.h @@ -19,6 +19,8 @@ #ifndef _PM_CALLBACK_H #define _PM_CALLBACK_H +#include <sys/types.h> /* off_t */ + #include <alpm.h> /* callback to handle messages/notifications from libalpm transactions */ @@ -33,7 +35,7 @@ void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent, int howmany, int remain); /* callback to handle display of download progress */ -void cb_dl_progress(const char *filename, int file_xfered, int file_total); +void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total); /* callback to handle messages/notifications from pacman library */ void cb_log(pmloglevel_t level, char *fmt, va_list args); |