[Pkg-libvirt-commits] [libguestfs] 02/14: journal: Fix binding of sd_journal_get_realtime_usec on 32 bit machines.
Hilko Bengen
bengen at moszumanska.debian.org
Sat Aug 30 08:29:25 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag upstream/1.27.21
in repository libguestfs.
commit a2747578ebfc92d19ca615d8fd462d9b826eafb5
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Wed Jul 2 16:17:05 2014 +0100
journal: Fix binding of sd_journal_get_realtime_usec on 32 bit machines.
sd_journal_get_realtime_usec is defined as:
int sd_journal_get_realtime_usec(sd_journal* j, uint64_t* usec);
Unfortunately we passed size_t* as the second argument. This happened
to work on 64 bit machines because size_t is 64 bit there, but failed
on 32 bit machines, where we didn't pass a sufficiently large result
buffer.
This fixes commit 2d996df66c8d67e11a91a89c074c91a233356494.
---
daemon/journal.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/daemon/journal.c b/daemon/journal.c
index 1351032..3fd2135 100644
--- a/daemon/journal.c
+++ b/daemon/journal.c
@@ -218,17 +218,17 @@ int64_t
do_journal_get_realtime_usec (void)
{
int r;
- size_t ret;
+ uint64_t usec;
NEED_HANDLE (-1);
- r = sd_journal_get_realtime_usec (j, &ret);
+ r = sd_journal_get_realtime_usec (j, &usec);
if (r < 0) {
reply_with_perror_errno (-r, "sd_journal_get_realtime_usec");
return -1;
}
- return ret;
+ return (int64_t) usec;
}
#else /* !HAVE_SD_JOURNAL */
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list