From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 82CA2138334 for ; Wed, 27 Mar 2019 20:18:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A5071E08EC; Wed, 27 Mar 2019 20:18:49 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 665C3E08EC for ; Wed, 27 Mar 2019 20:18:48 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7A83E335D04 for ; Wed, 27 Mar 2019 20:18:46 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 22681576 for ; Wed, 27 Mar 2019 20:18:45 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1553717900.3cf77d19bd7f3abd323e4f148f73575cee8ac85b.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/, / X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/contents.c libq/xpak.c libq/xsystem.c main.c main.h q.c qcache.c qgrep.c qlop.c qmerge.c qpkg.c qsearch.c qtegrity.c quse.c X-VCS-Directories: libq/ / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 3cf77d19bd7f3abd323e4f148f73575cee8ac85b X-VCS-Branch: master Date: Wed, 27 Mar 2019 20:18:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: d45550a7-a8cb-4ae7-a2aa-091c855d0e29 X-Archives-Hash: e97237e87bd5295208eb5bdcc1b11c49 commit: 3cf77d19bd7f3abd323e4f148f73575cee8ac85b Author: Fabian Groffen gentoo org> AuthorDate: Wed Mar 27 20:18:20 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Wed Mar 27 20:18:20 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3cf77d19 q: fix various issues on Linux systems Signed-off-by: Fabian Groffen gentoo.org> libq/contents.c | 1 + libq/xpak.c | 2 +- libq/xsystem.c | 7 +++++-- main.c | 4 ++-- main.h | 1 + q.c | 1 + qcache.c | 2 +- qgrep.c | 15 ++++++++++----- qlop.c | 1 + qmerge.c | 10 +++++----- qpkg.c | 4 ++-- qsearch.c | 1 + qtegrity.c | 3 +++ quse.c | 1 + 14 files changed, 35 insertions(+), 18 deletions(-) diff --git a/libq/contents.c b/libq/contents.c index 41929d0..3e719a6 100644 --- a/libq/contents.c +++ b/libq/contents.c @@ -11,6 +11,7 @@ #include #include +#include #include "contents.h" diff --git a/libq/xpak.c b/libq/xpak.c index 09b58bd..2785899 100644 --- a/libq/xpak.c +++ b/libq/xpak.c @@ -258,7 +258,7 @@ _xpak_add_file( /* the xpak format can only store files whose size is a 32bit int * so we have to make sure we don't store a big file */ if (in_len != st->st_size) { - warnf("File is too big: %"PRIu64, (uint64_t)st->st_size); + warnf("File is too big: %zu", (size_t)st->st_size); fclose(fin); goto fake_data_len; } diff --git a/libq/xsystem.c b/libq/xsystem.c index 1cc5cad..e11172e 100644 --- a/libq/xsystem.c +++ b/libq/xsystem.c @@ -6,12 +6,15 @@ */ #include "main.h" -#include "xasprintf.h" -#include "xsystem.h" #include #include #include +#include +#include + +#include "xasprintf.h" +#include "xsystem.h" void xsystem(const char *command) { diff --git a/main.c b/main.c index 1da04fe..7e56101 100644 --- a/main.c +++ b/main.c @@ -448,7 +448,7 @@ read_portage_env_file(const char *configroot, const char *file, env_vars vars[]) if ((dentslen = scandir(buf, &dents, NULL, alphasort)) > 0) { int di; struct dirent *d; - char npath[_Q_PATH_MAX]; + char npath[_Q_PATH_MAX * 2]; /* recurse through all files */ for (di = 0; di < dentslen; di++) { @@ -858,7 +858,7 @@ initialize_flat(const char *overlay, int cache_type, bool force) if (pkg_cnt < 0) continue; for (c = 0; c < pkg_cnt; c++) { - char de[_Q_PATH_MAX]; + char de[_Q_PATH_MAX * 2]; snprintf(de, sizeof(de), "%s/%s", category[i]->d_name, pn[c]->d_name); diff --git a/main.h b/main.h index 958efa6..32c995f 100644 --- a/main.h +++ b/main.h @@ -15,6 +15,7 @@ #endif #include +#include #include #include #include diff --git a/q.c b/q.c index a4a943e..1e180de 100644 --- a/q.c +++ b/q.c @@ -10,6 +10,7 @@ #include "main.h" #include "applets.h" +#include #include #include #include diff --git a/qcache.c b/qcache.c index 29b10af..f3252d7 100644 --- a/qcache.c +++ b/qcache.c @@ -805,7 +805,7 @@ qcache_stats(qcache_data *data) #endif { struct stat s; - char spath[_Q_PATH_MAX]; + char spath[_Q_PATH_MAX * 2]; snprintf(spath, sizeof(spath), "%s/%s", catpath, de->d_name); if (lstat(spath, &s) != 0) continue; diff --git a/qgrep.c b/qgrep.c index da38f40..fdabf9c 100644 --- a/qgrep.c +++ b/qgrep.c @@ -223,7 +223,12 @@ qgrep_print_before_context(qgrep_buf_t *current, const char num_lines_before, /* Yield the path of one of the installed ebuilds (from VDB). */ static char * -get_next_installed_ebuild(char *ebuild_path, DIR *vdb_dir, struct dirent **cat_dirent_pt, DIR **cat_dir_pt) +get_next_installed_ebuild( + char *ebuild_path, + size_t ebuild_path_len, + DIR *vdb_dir, + struct dirent **cat_dirent_pt, + DIR **cat_dir_pt) { struct dirent *pkg_dirent = NULL; if (*cat_dirent_pt == NULL || *cat_dir_pt == NULL) @@ -233,7 +238,7 @@ get_next_ebuild_from_category: goto get_next_category; if (pkg_dirent->d_name[0] == '.') goto get_next_ebuild_from_category; - snprintf(ebuild_path, _Q_PATH_MAX, "%s/%s/%s.ebuild", + snprintf(ebuild_path, ebuild_path_len, "%s/%s/%s.ebuild", (*cat_dirent_pt)->d_name, pkg_dirent->d_name, pkg_dirent->d_name); return ebuild_path; get_next_category: @@ -260,7 +265,7 @@ int qgrep_main(int argc, char **argv) DIR *vdb_dir = NULL; DIR *cat_dir = NULL; struct dirent *dentry = NULL; - char ebuild[_Q_PATH_MAX]; + char ebuild[_Q_PATH_MAX * 4]; char name[_Q_PATH_MAX * 2]; char *label; int reflags = 0; @@ -420,8 +425,8 @@ int qgrep_main(int argc, char **argv) && snprintf(ebuild, sizeof(ebuild), "eclass/%s", dentry->d_name)) : (do_installed - ? (get_next_installed_ebuild(ebuild, vdb_dir, - &dentry, &cat_dir) != NULL) + ? (get_next_installed_ebuild(ebuild, sizeof(ebuild), + vdb_dir, &dentry, &cat_dir) != NULL) : (fgets(ebuild, sizeof(ebuild), fp) != NULL))) { FILE *newfp; diff --git a/qlop.c b/qlop.c index b8038b4..b6970d0 100644 --- a/qlop.c +++ b/qlop.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "atom.h" #include "eat_file.h" diff --git a/qmerge.c b/qmerge.c index 81da0b1..97726db 100644 --- a/qmerge.c +++ b/qmerge.c @@ -850,13 +850,13 @@ merge_tree_at(int fd_src, const char *src, int fd_dst, const char *dst, int fd_srcf, fd_dstf; unsigned char *hash; const char *tmpname, *dname; - char buf[_Q_PATH_MAX]; + char buf[_Q_PATH_MAX * 2]; /* syntax: obj filename hash mtime */ hash = hash_file_at(subfd_src, name, HASH_MD5); if (!pretend) - fprintf(contents, "obj %s %s %"PRIu64"\n", - cpath, hash, (uint64_t)st.st_mtime); + fprintf(contents, "obj %s %s %zu""\n", + cpath, hash, (size_t)st.st_mtime); free(hash); /* Check CONFIG_PROTECT */ @@ -954,8 +954,8 @@ merge_tree_at(int fd_src, const char *src, int fd_dst, const char *dst, /* syntax: sym src -> dst mtime */ if (!pretend) - fprintf(contents, "sym %s -> %s %"PRIu64"\n", - cpath, sym, (uint64_t)st.st_mtime); + fprintf(contents, "sym %s -> %s %zu\n", + cpath, sym, (size_t)st.st_mtime); qprintf("%s>>>%s %s%s -> %s%s\n", GREEN, NORM, CYAN, cpath, sym, NORM); *objs = add_set(cpath, *objs); diff --git a/qpkg.c b/qpkg.c index 3ff4507..37f1cb7 100644 --- a/qpkg.c +++ b/qpkg.c @@ -77,7 +77,7 @@ qpkg_clean_dir(char *dirp, set *vdb) set *ll = NULL; struct dirent **fnames; int i, count; - char buf[_Q_PATH_MAX]; + char buf[_Q_PATH_MAX * 2]; struct stat st; uint64_t num_all_bytes = 0; size_t disp_units = 0; @@ -186,7 +186,7 @@ qpkg_clean(char *dirp) num_all_bytes = qpkg_clean_dir(dirp, vdb); for (i = 0; i < count; i++) { - char buf[_Q_PATH_MAX]; + char buf[_Q_PATH_MAX * 2]; snprintf(buf, sizeof(buf), "%s/%s", dirp, dnames[i]->d_name); num_all_bytes += qpkg_clean_dir(buf, vdb); } diff --git a/qsearch.c b/qsearch.c index 5ae68bc..f543b8a 100644 --- a/qsearch.c +++ b/qsearch.c @@ -11,6 +11,7 @@ #include "applets.h" #include +#include #include #include #include diff --git a/qtegrity.c b/qtegrity.c index 2e3b859..70a99d5 100644 --- a/qtegrity.c +++ b/qtegrity.c @@ -10,8 +10,11 @@ #include "main.h" #include "applets.h" +#include +#include #include #include +#include #include #include diff --git a/quse.c b/quse.c index 62ae166..c93be87 100644 --- a/quse.c +++ b/quse.c @@ -11,6 +11,7 @@ #include "applets.h" #include +#include #include #include #include