pkgtools

morpheus pkg tools
git clone git://git.2f30.org/pkgtools
Log | Files | Refs | README | LICENSE

commit d07450487d819af7eeb1eef758d4877e29503e8c
parent 8c15fc4d0fcdd717b56a8dff226c5049c1ebb8dd
Author: sin <sin@2f30.org>
Date:   Tue, 17 Jun 2014 14:58:31 +0100

Use wrappers in infopkg and fix style

Diffstat:
Minfopkg.c | 15++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/infopkg.c b/infopkg.c @@ -68,24 +68,18 @@ ownpkg(struct db *db, struct pkg *pkg, void *file) struct pkgentry *pe; struct stat sb1, sb2; char path[PATH_MAX]; - int r; realpath(file, path); - r = lstat(path, &sb1); - if (r < 0) { - fprintf(stderr, "lstat %s: %s\n", path, strerror(errno)); - exit(EXIT_FAILURE); - } + if (lstat(path, &sb1) < 0) + eprintf("lstat %s:", path); if (dbpkgload(db, pkg) < 0) exit(EXIT_FAILURE); for (pe = pkg->head; pe; pe = pe->next) { - r = lstat(pe->path, &sb2); - if (r < 0) { - fprintf(stderr, "lstat %s: %s\n", - pe->path, strerror(errno)); + if (lstat(pe->path, &sb2) < 0) { + weprintf("lstat %s:", pe->path); continue; } if (sb1.st_dev == sb2.st_dev && @@ -94,6 +88,5 @@ ownpkg(struct db *db, struct pkg *pkg, void *file) break; } } - return 0; }