summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-04-22 15:23:38 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-04-22 15:23:38 +0300
commit6e090dc5c5bdfad6f8a38d2a1efb47b361d98c7e (patch)
tree9315c7eed27d9ae9fc19cff1c74eb940a1f4a536
parent338c9be61eef414ea361ac849bc1f926429957f6 (diff)
downloadrpm-6e090dc5c5bdfad6f8a38d2a1efb47b361d98c7e.tar.gz
rpm-6e090dc5c5bdfad6f8a38d2a1efb47b361d98c7e.tar.bz2
rpm-6e090dc5c5bdfad6f8a38d2a1efb47b361d98c7e.zip
Simplify rebuild path generation
-rw-r--r--rpmdb/rpmdb.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c
index ba6ef2300..4bc70004d 100644
--- a/rpmdb/rpmdb.c
+++ b/rpmdb/rpmdb.c
@@ -3361,13 +3361,8 @@ int rpmdbRebuild(const char * prefix, rpmts ts,
tfn = rpmGetPath("%{?_dbpath_rebuild}", NULL);
if (!(tfn && tfn[0] != '\0' && strcmp(tfn, dbpath)))
{
- char pidbuf[20];
- char *t;
- sprintf(pidbuf, "rebuilddb.%d", (int) getpid());
- t = xmalloc(strlen(dbpath) + strlen(pidbuf) + 1);
- (void)stpcpy(stpcpy(t, dbpath), pidbuf);
tfn = _free(tfn);
- tfn = t;
+ rasprintf(&tfn, "%srebuilddb.%d", dbpath, (int) getpid());
nocleanup = 0;
}
newdbpath = newrootdbpath = rpmGetPath(prefix, tfn, NULL);