From: Paul Nasrat Date: Thu, 22 Feb 2007 14:15:30 +0000 (+0000) Subject: Make fcntl lock sensitive to --root (#151255) X-Git-Tag: tznext/4.11.0.1.tizen20130304~6036 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a465e0637a2630c167d0e5338922f2a26a7edf01;p=tools%2Flibrpm-tizen.git Make fcntl lock sensitive to --root (#151255) --- diff --git a/lib/rpmlock.c b/lib/rpmlock.c index c14dc55..7bf932f 100644 --- a/lib/rpmlock.c +++ b/lib/rpmlock.c @@ -37,7 +37,7 @@ static rpmlock rpmlock_new(/*@unused@*/ const char *rootdir) /* XXX oneshot to determine path for fcntl lock. */ if (rpmlock_path == NULL) { - char * t = rpmExpand(rpmlock_path_default, NULL); + char * t = rpmGenPath(rootdir, rpmlock_path_default, NULL); if (t == NULL || *t == '\0' || *t == '%') t = RPMLOCK_PATH; rpmlock_path = xstrdup(t); @@ -129,7 +129,7 @@ void *rpmtsAcquireLock(rpmts ts) const char *rootDir = rpmtsRootDir(ts); rpmlock lock; - if (!rootDir) + if (!rootDir || rpmtsChrootDone(ts)) rootDir = "/"; lock = rpmlock_new(rootDir); /*@-branchstate@*/