Commit Graph

38 Commits

Author SHA1 Message Date
Panu Matilainen 1f625e69e9 Further generalize the rpmlock interface
- Move transaction lock path handling into rpmts.c, export new low
  level rpmlockAcquire() function to actually grab a lock
- Rename rpmtsFreeLock() to rpmlockFree() and return NULL in the
  general rpm style
2010-04-22 11:01:27 +03:00
Panu Matilainen d2810bdc52 Generalize rpmlock_new() by moving transaction lock path calculation out 2010-04-22 10:44:38 +03:00
Panu Matilainen 35c563af8c Make rpmlock type visible inside rpm, use instead of void* 2010-04-22 10:37:51 +03:00
Panu Matilainen dd58384ede Move <errno.h> include out of system.h to the places that need it 2010-01-05 15:25:31 +02:00
Panu Matilainen c339c36144 Move the default transaction lock out of BDB environment namespace
- We dont want the transaction lock to get mixed with the BDB environment,
  nor do we want it wiped out with it as the ts lock protects things
  *around* the environment. Unlike the environment, any fcntl locks on
  the file get released when process dies, so if there is a lock,
  there's a process alive holding it and you'd better not remove it.
- Use the same lock path in macro configuration and built-in fallback
- Make it a hidden file to avoid people confusing lock file existence
  with it actually being locked
2009-09-16 15:47:11 +03:00
Panu Matilainen 666e26bd7a Oops, missing include for dirname() 2009-07-09 15:07:38 +03:00
Panu Matilainen 17f9073278 Create the directory used for transaction lock if necessary
- otherwise at least rpm --initdb can fail due to transaction locking failing
2009-07-09 14:40:17 +03:00
Jindrich Novy 50ef054902 Use safer xstrdup() instead of strdup() wherever possible 2008-09-25 20:03:50 +02:00
Panu Matilainen eca89ea370 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")
2008-04-01 13:35:16 +03:00
Panu Matilainen d183928902 Convert rpmlock.c to general rpm indentation style 2008-04-01 13:32:57 +03:00
Panu Matilainen 3be0a4b2f8 Another pile of read-only constants marked as such.. 2008-03-07 08:20:03 +02:00
Panu Matilainen eb5dc35c19 Include spring-cleaning
- put some consistency into include ordering
- everything (apart from bits missed ;) is now ordered like this
  1. "system.h"
  2. other system includes
  3. rpm public headers
  4. rpm private headers
  5. "debug.h"
2008-01-30 17:05:29 +02:00
Panu Matilainen 99faa2735b rpmlib.h mass eviction
- explicitly include what's really needed instead
- document remaining uses
2008-01-30 13:53:51 +02:00
Panu Matilainen 1a0a12cf15 Remove bogus const from rpmGenPath() temporary targets 2007-12-15 11:03:46 +02:00
Panu Matilainen 9ce13e09ef Switch to <rpm/foo.h> style for public headers
- adjust include paths accordingly
2007-12-08 14:02:32 +02:00
Panu Matilainen 89527785bb Move logging related macros rpmlog, adjust includes 2007-11-30 23:08:38 +02:00
Ralf Corsépius 60939d6985 Expand private include file names to be relative to $(top_srcdir) 2007-11-23 11:39:29 +01:00
Panu Matilainen 2c6905dd9f Move rpmGetPath and rpmGenPath to rpmfileutil.h 2007-11-23 10:20:19 +02:00
Ralf Corsépius abeea80a38 Use #include <x.h> syntax to include public headers. 2007-11-23 06:46:19 +01:00
Ralf Corsépius f25c04c1e4 Include "rpmlib.h" instead of <rpmlib.h>. 2007-10-28 06:47:31 +01:00
Ralf Corsépius e36a2ac8da Include "rpmmacro.h" instead of <rpmmacro.h>. 2007-10-28 06:32:05 +01:00
Panu Matilainen 0eb7deabf2 Replace all uses of RPMMESS_WARNING with RPMLOG_WARNING 2007-10-09 14:52:01 +03:00
Panu Matilainen c52905d334 Replace all uses of RPMMESS_ERROR with RPMLOG_ERR 2007-10-09 14:49:02 +03:00
Panu Matilainen 4ce9fc1a17 Replace all rpmMessage() uses with rpmlog() 2007-10-09 14:14:30 +03:00
Ralf Corsépius ebef4f211c Remove splint tags. 2007-09-11 19:07:39 +02:00
Ralf Corsépius c4095e6233 Use LOCALSTATEDIR instead of hard-coded /var. 2007-08-31 08:55:24 +02:00
Panu Matilainen 29dbb10c1f Some obvious "missing const" cases... 2007-07-12 09:20:09 +03:00
Paul Nasrat 6214fb8563 Fix potential segfault if no rpmlock_path defined (rh#231146) 2007-03-13 10:32:40 +00:00
Paul Nasrat a465e0637a Make fcntl lock sensitive to --root (#151255) 2007-02-22 14:15:30 +00:00
jbj ff75214217 Remove unused _rpmlock_file.
CVS patchset: 7716
CVS date: 2005/01/28 02:17:08
2005-01-28 02:17:08 +00:00
jbj cd8de55c26 - move global /var/lock/rpm/transaction to dbpath.
- permit fcntl path to be configured through rpmlock_path macro.

CVS patchset: 7712
CVS date: 2005/01/26 04:05:34
2005-01-26 04:05:34 +00:00
jbj 60057a2de1 Splint fiddles.
CVS patchset: 7195
CVS date: 2004/03/26 17:27:57
2004-03-26 17:27:57 +00:00
jbj 8fa552c691 Change lock file location.
Lock in outer, not in chroot, file tree for now.

CVS patchset: 7142
CVS date: 2004/03/02 21:55:03
2004-03-02 21:55:03 +00:00
jbj f3cd4db8ea use static variable, not define, for lock file path.
CVS patchset: 7135
CVS date: 2004/02/26 01:23:48
2004-02-26 01:23:48 +00:00
jbj 99825287bd splint fiddles.
CVS patchset: 7134
CVS date: 2004/02/26 01:20:52
2004-02-26 01:20:52 +00:00
niemeyer 55eec2cbdc It was 2 bytes, not one. Amateurs.. humpf. ;-)
CVS patchset: 7132
CVS date: 2004/02/25 20:04:36
2004-02-25 20:04:36 +00:00
niemeyer 037f02539c Oops. "path" was being allocated with 1 byte less than necessary.
CVS patchset: 7131
CVS date: 2004/02/25 20:02:23
2004-02-25 20:02:23 +00:00
niemeyer 0f828b95fc Creating transaction locking scheme based on fcntl file locking
during writing operations. For now, this system will wait forever
for the lock to be released. This will ensure that current
applications will get the necessary protection without breaking
unexpectedly.
Modified Files:
	lib/Makefile.am lib/rpmts.c lib/transaction.c
Added Files:
	lib/rpmlock.c lib/rpmlock.h

CVS patchset: 7130
CVS date: 2004/02/25 19:54:58
2004-02-25 19:54:58 +00:00