From f93e89deda709f0ab7b7e2d025c74bca507b1249 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 16 Jan 2010 21:31:57 +0000 Subject: only warn and avoid exiting if we find a file in the pkg db #301221 by Petteri Räty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qfile.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'qfile.c') diff --git a/qfile.c b/qfile.c index 3d493e45..2f5f105e 100644 --- a/qfile.c +++ b/qfile.c @@ -1,7 +1,7 @@ /* * Copyright 2005-2007 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/qfile.c,v 1.49 2010/01/13 19:01:34 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/qfile.c,v 1.50 2010/01/16 21:31:57 vapier Exp $ * * Copyright 2005-2007 Ned Ludd - * Copyright 2005-2007 Mike Frysinger - @@ -34,7 +34,7 @@ static const char *qfile_opts_help[] = { "Display installed packages with slots", COMMON_OPTS_HELP }; -static char qfile_rcsid[] = "$Id: qfile.c,v 1.49 2010/01/13 19:01:34 vapier Exp $"; +static char qfile_rcsid[] = "$Id: qfile.c,v 1.50 2010/01/16 21:31:57 vapier Exp $"; #define qfile_usage(ret) usage(ret, QFILE_FLAGS, qfile_long_opts, qfile_opts_help, lookup_applet_idx("qfile")) #define qfile_is_prefix(path, prefix, prefix_length) \ @@ -78,9 +78,11 @@ void qfile(char *path, const char *root, qfile_args_t *args) char *bn_firstchars = args->bn_firstchars; short *non_orphans = args->non_orphans; - xchdir(path); - if ((dir = opendir(".")) == NULL) + if ((dir = opendir(path)) == NULL) { + warnp("opendir(%s) failed", path); return; + } + xchdir(path); while ((dentry = readdir(dir))) { if (dentry->d_name[0] == '.') -- cgit v1.2.3-65-gdbad