diff options
author | Stephen M. Webb <stephen.webb@canonical.com> | 2013-01-30 20:39:11 -0500 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-02-01 10:57:27 +1000 |
commit | e1168f49fb7d559463967a692597214f9ce46e9c (patch) | |
tree | 4f0dc587adf2dcf08f6054e0f38a8558c2c5bcb1 | |
parent | 2bc9c835b31b27d3c6f8d3b501591e100a6a91ac (diff) |
silenced truncation warnings on i386 targets
Code using xorg-gtest and compiling on 32-bit x86 targets using
GCC 4.7 or later get a truncation warning setting timeouts for
sigtimedwait(). If the code sets -Werror this is fatal.
This patch prevents those warnings.
Signed-off-by: Stephen M. Webb <stephen.webb@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/process.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/process.cpp b/src/process.cpp index 9580569..35831d7 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -152,8 +152,9 @@ bool xorg::testing::Process::WaitForExit(unsigned int timeout) { sigaddset(&sig_mask, SIGCHLD); if (sigprocmask(SIG_BLOCK, &sig_mask, &old_mask) == 0) { - struct timespec sig_timeout = {timeout / 1000, - (timeout % 1000) * 1000000L}; + long tv_secs = timeout / 1000; + long tv_usecs = (timeout % 1000) * 1000000L; + struct timespec sig_timeout = { tv_secs, tv_usecs }; if (sigtimedwait(&sig_mask, NULL, &sig_timeout) != SIGCHLD && errno != EAGAIN) usleep(timeout * 1000); |