commit: 6b5210240228f6bbc67b3e32af1d840a8e66b645 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> AuthorDate: Thu Dec 29 02:16:54 2016 +0000 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> CommitDate: Thu Dec 29 02:16:54 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=6b521024
qmerge: pass struct by ref instead of value Avoids having to create a copy of a large struct whenever we make a call. qmerge.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qmerge.c b/qmerge.c index 2c92599..05e46b4 100644 --- a/qmerge.c +++ b/qmerge.c @@ -287,7 +287,7 @@ config_protected(const char *buf, int cp_argc, char **cp_argv, } static void -crossmount_rm(const char *fname, const struct stat st) +crossmount_rm(const char *fname, const struct stat * const st) { struct stat lst; @@ -295,7 +295,7 @@ crossmount_rm(const char *fname, const struct stat st) if (lstat(fname, &lst) == -1) return; - if (lst.st_dev != st.st_dev) { + if (lst.st_dev != st->st_dev) { warn("skipping crossmount install masking: %s", fname); return; } @@ -304,7 +304,7 @@ crossmount_rm(const char *fname, const struct stat st) } static void -install_mask_pwd(int iargc, char **iargv, const struct stat st) +install_mask_pwd(int iargc, char **iargv, const struct stat * const st) { char buf[1024]; int i; @@ -931,7 +931,7 @@ pkg_merge(int level, const depend_atom *atom, const struct pkg_t *pkg) makeargv(install_mask, &iargc, &iargv); /* XXX: Would be better if INSTALL_MASK deleted from image/ * so we didn't have to parse it while doing merge_tree() */ - install_mask_pwd(iargc, iargv, st); + install_mask_pwd(iargc, iargv, &st); if (strstr(features, "noinfo")) rm_rf("./usr/share/info"); if (strstr(features, "noman" )) rm_rf("./usr/share/man");