aboutsummaryrefslogtreecommitdiff
path: root/runit
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-10-13 14:50:20 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2015-10-13 14:50:20 +0200
commitab3964db4e75e34f6f9347406c5fd2bced04f2dd (patch)
tree92113e4a008338ed8534858db97d3a5e09dc210b /runit
parentf7ad927c2059ef9cd1cd6befeb43f26b92f6369f (diff)
downloadbusybox-w32-ab3964db4e75e34f6f9347406c5fd2bced04f2dd.tar.gz
busybox-w32-ab3964db4e75e34f6f9347406c5fd2bced04f2dd.tar.bz2
busybox-w32-ab3964db4e75e34f6f9347406c5fd2bced04f2dd.zip
libbb: introduce kernel-style BUILD_BUG_ON()
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'runit')
-rw-r--r--runit/runsv.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/runit/runsv.c b/runit/runsv.c
index 94d286059..6cf5bcc29 100644
--- a/runit/runsv.c
+++ b/runit/runsv.c
@@ -49,16 +49,11 @@ static void gettimeofday_ns(struct timespec *ts)
49#else 49#else
50static void gettimeofday_ns(struct timespec *ts) 50static void gettimeofday_ns(struct timespec *ts)
51{ 51{
52 if (sizeof(struct timeval) == sizeof(struct timespec) 52 BUILD_BUG_ON(sizeof(struct timeval) != sizeof(struct timespec));
53 && sizeof(((struct timeval*)ts)->tv_usec) == sizeof(ts->tv_nsec) 53 BUILD_BUG_ON(sizeof(((struct timeval*)ts)->tv_usec) != sizeof(ts->tv_nsec));
54 ) { 54 /* Cheat */
55 /* Cheat */ 55 gettimeofday((void*)ts, NULL);
56 gettimeofday((void*)ts, NULL); 56 ts->tv_nsec *= 1000;
57 ts->tv_nsec *= 1000;
58 } else {
59 extern void BUG_need_to_implement_gettimeofday_ns(void);
60 BUG_need_to_implement_gettimeofday_ns();
61 }
62} 57}
63#endif 58#endif
64 59