commit:     e7518595307c5561c9b86fca5ef34fde379717a6
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 24 09:34:12 2026 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Jan 24 09:34:12 2026 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e7518595

libq/tree: remove unnecessary memsets for stat structure

fstat* functions fill in the stat structure completely

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 libq/tree.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/libq/tree.c b/libq/tree.c
index 00b4102..f7f9d12 100644
--- a/libq/tree.c
+++ b/libq/tree.c
@@ -438,7 +438,6 @@ tree_ctx *tree_new
     return NULL;
   }
 
-  VAL_CLEAR(st);
   if (fstatat(ret->portroot_fd, path, &st, 0) < 0)
   {
     if (!quiet)
@@ -467,7 +466,6 @@ tree_ctx *tree_new
       /* look for gtree, in which case we will ignore this tree in
        * favour of the gtree container */
       snprintf(buf, sizeof(buf), "%s/metadata/repo.gtree.tar", path);
-      VAL_CLEAR(st);
       if (fstatat(ret->portroot_fd, buf, &st, 0) == 0 &&
           S_ISREG(st.st_mode))
       {
@@ -1922,7 +1920,6 @@ int tree_foreach_pkg
 
       /* just probe to see if there is a directory named like this */
       snprintf(buf, sizeof(buf), "%s/%s", tree->path, query->CATEGORY);
-      VAL_CLEAR(sb);
       if (fstatat(tree->portroot_fd, buf, &sb, 0) < 0 ||
           !S_ISDIR(sb.st_mode))
         return 0;

Reply via email to