use static variable, not define, for lock file path.
authorjbj <devnull@localhost>
Thu, 26 Feb 2004 01:23:48 +0000 (01:23 +0000)
committerjbj <devnull@localhost>
Thu, 26 Feb 2004 01:23:48 +0000 (01:23 +0000)
CVS patchset: 7135
CVS date: 2004/02/26 01:23:48

lib/rpmlock.c

index 0ac8703..8e642d8 100644 (file)
@@ -17,6 +17,9 @@
 
 #define RPMLOCK_FILE "/var/lib/rpm/transaction.lock"
 
+/*@observer@*/ /*@unchecked@*/
+static const char * _rpmlock_file = RPMLOCK_FILE;
+
 enum {
        RPMLOCK_READ   = 1 << 0,
        RPMLOCK_WRITE  = 1 << 1,
@@ -37,7 +40,7 @@ static rpmlock rpmlock_new(const char *rootdir)
        if (lock) {
                mode_t oldmask = umask(022);
                char *path = (char *)malloc(strlen(rootdir)+
-                                           sizeof(RPMLOCK_FILE)+1);
+                                           strlen(RPMLOCK_FILE)+2);
                if (!path) {
                        free(lock);
                        return NULL;