From 1ff11482b3cffcecaadd865bf51c900fdbfd87fe Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 18 Apr 2007 17:31:19 +0000 Subject: make sure qcache_read_cache_file() worked --- qcache.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'qcache.c') diff --git a/qcache.c b/qcache.c index a9033c4d..0c4b2386 100644 --- a/qcache.c +++ b/qcache.c @@ -1,7 +1,7 @@ /* * Copyright 2005-2006 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/qcache.c,v 1.23 2007/04/06 20:50:19 solar Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/qcache.c,v 1.24 2007/04/18 17:31:19 vapier Exp $ * * Copyright 2006 Thomas A. Cort - */ @@ -48,7 +48,7 @@ static const char *qcache_opts_help[] = { COMMON_OPTS_HELP }; -static const char qcache_rcsid[] = "$Id: qcache.c,v 1.23 2007/04/06 20:50:19 solar Exp $"; +static const char qcache_rcsid[] = "$Id: qcache.c,v 1.24 2007/04/18 17:31:19 vapier Exp $"; #define qcache_usage(ret) usage(ret, QCACHE_FLAGS, qcache_long_opts, qcache_opts_help, lookup_applet_idx("qcache")) /********************************************************************/ @@ -582,12 +582,14 @@ int qcache_traverse(void (*func)(qcache_data*)) snprintf(cachepath, len, "%s/%s/%s", catpath, categories[i]->d_name, ebuilds[k]->d_name); cachepath[len-8] = '\0'; /* remove ".ebuild" */ - data.cache_data = qcache_read_cache_file(cachepath); data.category = categories[i]->d_name; data.package = packages[j]->d_name; data.ebuild = ebuilds[k]->d_name; data.cur = k + 1; data.num = num_ebuild; + data.cache_data = qcache_read_cache_file(cachepath); + if (data.cache_data == NULL) + err("unable to read the cache data at '%s'", cachepath); /* is this the last ebuild? */ if (i+1 == num_cat && j+1 == num_pkg && k+1 == num_ebuild) -- cgit v1.2.3-65-gdbad