1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/mine/short-reads.patch
3 # Copyright (C) 2021 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This patch file is dual-licensed. It is available under the license the
9 # patched project is licensed under, as long as it is an OpenSource license
10 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
11 # of the GNU General Public License version 2 as used by the T2 SDE.
12 # --- T2-COPYRIGHT-NOTE-END ---
14 Musl returns short reads for pipes, so deal with that.
15 Also increase the buffer size to 4k for a little better
16 performance while at it.
18 --- mine-0.23/install.c.vanilla 2021-10-15 22:38:22.519423662 +0200
19 +++ mine-0.23/install.c 2021-10-15 22:51:39.237464764 +0200
23 char *decompressor = 0;
25 + char buffer[4*1024];
31 md5sum_initdb(root, mode_verbose);
33 - if (tar_fdopen(&t, bunzip2tar[0], "pipe", NULL,
34 + if (tar_fdopen(&t, bunzip2tar[0], "-", NULL,
35 O_RDONLY, 0, 0) == -1) goto error_errno;
36 if ( mode_test && mode_verbose ) printf("-- %s --\n", pname);
38 --- mine-0.23/libtar-1.2.11/lib/handle.c.vanilla 2021-10-15 23:47:57.270639034 +0200
39 +++ mine-0.23/libtar-1.2.11/lib/handle.c 2021-10-15 23:55:00.511660869 +0200
42 const char libtar_version[] = PACKAGE_VERSION;
44 -static tartype_t default_type = { open, close, read, write };
45 +ssize_t readfn(int fd, void* _buf, size_t n) {
46 + char* buf = (char*)_buf;
47 + ssize_t off = 0, ret;
49 + ret = read(fd, buf + off, n - off);
61 +static tartype_t default_type = { open, close, readfn, write };