[pacman-dev] [PATCH 2/3] be_sync: fetch only entry mode, not full stat struct

Dan McGee dan at archlinux.org
Tue Sep 27 18:57:11 EDT 2011


This saves a lot of unnecessary work since we don't need any of the
other fields in the stat struct.

Signed-off-by: Dan McGee <dan at archlinux.org>
---
 lib/libalpm/be_sync.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index 4864616..53777d9 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -454,11 +454,8 @@ static int sync_db_populate(alpm_db_t *db)
 	}
 
 	while(archive_read_next_header(archive, &entry) == ARCHIVE_OK) {
-		const struct stat *st;
-
-		st = archive_entry_stat(entry);
-
-		if(S_ISDIR(st->st_mode)) {
+		mode_t mode = archive_entry_mode(entry);
+		if(S_ISDIR(mode)) {
 			continue;
 		} else {
 			/* we have desc, depends or deltas - parse it */
-- 
1.7.6.4



More information about the pacman-dev mailing list