diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-04-01 13:35:16 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-04-01 13:35:16 +0300 |
commit | eca89ea370d2c52442d2817a13bc50023f3294f6 (patch) | |
tree | ed800a3d2371f60ffef1c82c9c6887180dcdccd4 /lib/rpmlock.c | |
parent | d1839289023dd4b7cd66f43f8d83b39bb5243ee3 (diff) | |
download | rpm-eca89ea370d2c52442d2817a13bc50023f3294f6.tar.gz rpm-eca89ea370d2c52442d2817a13bc50023f3294f6.tar.bz2 rpm-eca89ea370d2c52442d2817a13bc50023f3294f6.zip |
Enhance error message on failed ts lock acquire (rhbz#427064)
- adds strerror() output to the failure log message, this should give
sufficient hint as to what's wrong (eg "permission denied")
Diffstat (limited to 'lib/rpmlock.c')
-rw-r--r-- | lib/rpmlock.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/rpmlock.c b/lib/rpmlock.c index 0f1930c22..22dfc3424 100644 --- a/lib/rpmlock.c +++ b/lib/rpmlock.c @@ -117,14 +117,16 @@ void *rpmtsAcquireLock(rpmts ts) lock = rpmlock_new(rootDir); if (!lock) { rpmlog(RPMLOG_ERR, - _("can't create transaction lock on %s\n"), rpmlock_path); + _("can't create transaction lock on %s (%s)\n"), + rpmlock_path, strerror(errno)); } else if (!rpmlock_acquire(lock, RPMLOCK_WRITE)) { if (lock->openmode & RPMLOCK_WRITE) rpmlog(RPMLOG_WARNING, _("waiting for transaction lock on %s\n"), rpmlock_path); if (!rpmlock_acquire(lock, RPMLOCK_WRITE|RPMLOCK_WAIT)) { rpmlog(RPMLOG_ERR, - _("can't create transaction lock on %s\n"), rpmlock_path); + _("can't create transaction lock on %s (%s)\n"), + rpmlock_path, strerror(errno)); rpmlock_free(lock); lock = NULL; } |