Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/util/pactree.c
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2011-10-10 15:22:52 +0200
committerDan McGee <dan@archlinux.org>2011-10-10 19:09:18 -0500
commit8f414cd040aa11957a443ddda42ad14b83733007 (patch)
tree7f50d4c988a1ef87b67f98f05e79fbae43deaf68 /src/util/pactree.c
parentfb401f569e2d85cf90e45deeeeb28992360d60f7 (diff)
pactree: Make error message smarter in register_syncs()
Our error message used to be very unclear when the configuration file could not be found: $ ./pactree -lsr gtk error: failed to register sync DBs Instead, display an accurate message and include the file name: $ ./pactree -lsr gtk error: config file /usr/local/etc/pacman.conf could not be read Also, move the error message inside register_syncs() to allow for differentiating between different errors that might require a handler in the future. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/util/pactree.c')
-rw-r--r--src/util/pactree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/pactree.c b/src/util/pactree.c
index 5e98f794..997ba466 100644
--- a/src/util/pactree.c
+++ b/src/util/pactree.c
@@ -162,6 +162,7 @@ static int register_syncs(void) {
fp = fopen(configfile, "r");
if(!fp) {
+ fprintf(stderr, "error: config file %s could not be read\n", configfile);
return 1;
}
@@ -463,7 +464,6 @@ int main(int argc, char *argv[])
if(searchsyncs) {
if(register_syncs() != 0) {
- fprintf(stderr, "error: failed to register sync DBs\n");
ret = 1;
goto finish;
}