summaryrefslogtreecommitdiff
path: root/dpkg-split
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2010-12-31 17:24:44 +0100
committerGuillem Jover <guillem@debian.org>2011-01-08 17:17:40 +0100
commit1d779cecab2016047a433a5175764c0e2951ba9d (patch)
treeecff968c1de5ac9babf3a1a64bc7c1408090e3a4 /dpkg-split
parent6bb0ab0608fdd2509a8d2b84cd75ae01fa5e64c5 (diff)
downloaddpkg-1d779cecab2016047a433a5175764c0e2951ba9d.tar.gz
dpkg-split: Do not pass partsize to mksplit() and compute it internally
Diffstat (limited to 'dpkg-split')
-rw-r--r--dpkg-split/split.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/dpkg-split/split.c b/dpkg-split/split.c
index f40ea67dc..7d484d0c3 100644
--- a/dpkg-split/split.c
+++ b/dpkg-split/split.c
@@ -110,14 +110,15 @@ clean_msdos_filename(char *filename)
}
static int
-mksplit(const char *file_src, const char *prefix, size_t partsize,
- size_t maxpartsize, bool msdos)
+mksplit(const char *file_src, const char *prefix, size_t maxpartsize,
+ bool msdos)
{
int fd_src;
struct stat st;
char hash[MD5HASHLEN + 1];
char *package, *version;
int nparts, curpart;
+ off_t partsize;
char *prefixdir = NULL, *msdos_prefix = NULL;
struct varbuf file_dst = VARBUF_INIT;
struct varbuf partmagic = VARBUF_INIT;
@@ -139,6 +140,7 @@ mksplit(const char *file_src, const char *prefix, size_t partsize,
package = deb_field(file_src, "Package");
version = deb_field(file_src, "Version");
+ partsize = maxpartsize - HEADERALLOWANCE;
nparts = (st.st_size + partsize - 1) / partsize;
setvbuf(stdout, NULL, _IONBF, 0);
@@ -242,7 +244,6 @@ void
do_split(const char *const *argv)
{
const char *sourcefile, *prefix;
- size_t partsize;
sourcefile = *argv++;
if (!sourcefile)
@@ -263,9 +264,8 @@ do_split(const char *const *argv)
}
prefix = palloc;
}
- partsize = opt_maxpartsize - HEADERALLOWANCE;
- mksplit(sourcefile, prefix, partsize, opt_maxpartsize, opt_msdos);
+ mksplit(sourcefile, prefix, opt_maxpartsize, opt_msdos);
exit(0);
}