summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog5
-rw-r--r--sbuild/sbuild-lock.cc28
2 files changed, 16 insertions, 17 deletions
diff --git a/debian/changelog b/debian/changelog
index 746c0c9..385c1b6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,8 +8,11 @@ schroot (1.2.1-1) unstable; urgency=low
- Update vi translation (Closes: #479750). Thanks to Clytie Siddall.
- Add zh_CN translation (Closes: #480174). Thanks to LI Daobing (李道兵).
- Update zh_CN translation. Thanks to Ji ZhengYu.
+ * sbuild/sbuild-lock.cc: Order of "struct flock" members is not assumed,
+ for GNU/kFreeBSD portability (Closes: #485637). Thanks to Petr
+ Salinger.
- -- Roger Leigh <rleigh@debian.org> Mon, 19 May 2008 23:27:21 +0100
+ -- Roger Leigh <rleigh@debian.org> Sun, 29 Jun 2008 16:41:02 +0100
schroot (1.2.0-1) unstable; urgency=low
diff --git a/sbuild/sbuild-lock.cc b/sbuild/sbuild-lock.cc
index 681f53c..b61ebda 100644
--- a/sbuild/sbuild-lock.cc
+++ b/sbuild/sbuild-lock.cc
@@ -163,14 +163,12 @@ file_lock::~file_lock ()
// destructor under any circumstances. Any error is logged.
if (locked)
{
- struct flock read_lock =
- {
- LOCK_NONE,
- SEEK_SET,
- 0,
- 0, // Lock entire file
- 0
- };
+ struct flock read_lock;
+ read_lock.l_type = LOCK_NONE;
+ read_lock.l_whence = SEEK_SET;
+ read_lock.l_start = 0;
+ read_lock.l_len = 0; // Lock entire file
+ read_lock.l_pid = 0;
if (fcntl(this->fd, F_SETLK, &read_lock) == -1)
log_exception_warning(error(UNLOCK, strerror(errno)));
@@ -195,14 +193,12 @@ file_lock::set_lock (lock::type lock_type,
/* Wait on lock until interrupted by a signal if a timeout was set,
otherwise return immediately. */
- struct flock read_lock =
- {
- lock_type,
- SEEK_SET,
- 0,
- 0, // Lock entire file
- 0
- };
+ struct flock read_lock;
+ read_lock.l_type = lock_type;
+ read_lock.l_whence = SEEK_SET;
+ read_lock.l_start = 0;
+ read_lock.l_len = 0; // Lock entire file
+ read_lock.l_pid = 0;
if (fcntl(this->fd,
(timeout != 0) ? F_SETLKW : F_SETLK,