Skip to contentSkip to conversation

svn commit: trunk/buildroot/package/busybox

Buildroot jacmet at uclibc.org 1 participant 1 message Sep 10, 2007

lore
Share & tools
lore
#0 lore raw

Author: jacmet
Date: 2007-09-10 00:38:03 -0700 (Mon, 10 Sep 2007) New Revision: 19808

Log:
Busybox 1.7.0 patches

Added:
trunk/buildroot/package/busybox/busybox-1.7.0-gettimeofday_ns.patch trunk/buildroot/package/busybox/busybox-1.7.0-readlink.patch trunk/buildroot/package/busybox/busybox-1.7.0-targz_nommu.patch trunk/buildroot/package/busybox/busybox-1.7.0-trylink.patch

Changeset:
Added: trunk/buildroot/package/busybox/busybox-1.7.0-gettimeofday_ns.patch
===================================================================

buildroot/package/busybox/busybox-1.7.0-gettimeofday_ns.patch +95 -0
@@ -0,0 +1,95 @@
+diff -urN busybox-1.7.0/networking/isrv.c busybox-1.7.0-gettimeofday_ns/networking/isrv.c
+--- busybox-1.7.0/networking/isrv.c	2007-08-24 11:49:41.000000000 +0100
++++ busybox-1.7.0-gettimeofday_ns/networking/isrv.c	2007-09-06 17:39:55.000000000 +0100
+@@ -21,20 +21,6 @@
+ 
+ /* Helpers */
+ 
+-/* Even if _POSIX_MONOTONIC_CLOCK is defined, this
+- * may require librt */
+-#if 0 /*def _POSIX_MONOTONIC_CLOCK*/
+-static time_t monotonic_time(void)
+-{
+-	struct timespec ts;
+-	if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0)
+-		time(&ts.tv_sec);
+-	return ts.tv_sec;
+-}
+-#else
+-#define monotonic_time() (time(NULL))
+-#endif
+-
+ /* Opaque structure */
+ 
+ struct isrv_state_t {
+@@ -258,7 +244,7 @@
+ 			/* this peer is gone */
+ 			remove_peer(state, peer);
+ 		} else if (TIMEOUT) {
+-			TIMEO_TBL[peer] = monotonic_time();
++			TIMEO_TBL[peer] = monotonic_sec();
+ 		}
+ 	}
+ }
+@@ -335,7 +321,7 @@
+ 			break;
+ 
+ 		if (timeout) {
+-			time_t t = monotonic_time();
++			time_t t = monotonic_sec();
+ 			if (t != CURTIME) {
+ 				CURTIME = t;
+ 				handle_timeout(state, do_timeout);
+diff -urN busybox-1.7.0/runit/runsv.c busybox-1.7.0-gettimeofday_ns/runit/runsv.c
+--- busybox-1.7.0/runit/runsv.c	2007-08-24 11:50:01.000000000 +0100
++++ busybox-1.7.0-gettimeofday_ns/runit/runsv.c	2007-09-06 17:39:55.000000000 +0100
+@@ -33,6 +33,34 @@
+ #include "libbb.h"
+ #include "runit_lib.h"
+ 
++#if ENABLE_MONOTONIC_SYSCALL
++#include <sys/syscall.h>
++
++/* libc has incredibly messy way of doing this,
++ * typically requiring -lrt. We just skip all this mess */
++static void gettimeofday_ns(struct timespec *ts)
++{
++	syscall(__NR_clock_gettime, CLOCK_REALTIME, ts);
++}
++#else
++static void gettimeofday_ns(struct timespec *ts)
++{
++	if (sizeof(struct timeval) == sizeof(struct timespec)
++	 && sizeof(((struct timeval*)ts)->tv_usec) == sizeof(ts->tv_nsec)
++	) {
++		/* Cheat */
++		gettimeofday((void*)ts, NULL);
++		ts->tv_nsec *= 1000;
++	} else {
++		extern void BUG_need_to_implement_gettimeofday_ns(void);
++		BUG_need_to_implement_gettimeofday_ns();
++	}
++}
++#endif
++
++/* Compare possibly overflowing unsigned counters */
++#define LESS(a,b) ((int)((unsigned)(b) - (unsigned)(a)) > 0)
++
+ static int selfpipe[2];
+ 
+ /* state */
+@@ -126,14 +154,6 @@
+ 	return 0;
+ }
+ 
+-#define LESS(a,b) ((int)((unsigned)(b) - (unsigned)(a)) > 0)
+-
+-#include <sys/syscall.h>
+-static void gettimeofday_ns(struct timespec *ts)
+-{
+-	syscall(__NR_clock_gettime, CLOCK_REALTIME, ts);
+-}
+-
+ static void update_status(struct svdir *s)
+ {
+ 	ssize_t sz;

Added: trunk/buildroot/package/busybox/busybox-1.7.0-readlink.patch
===================================================================

buildroot/package/busybox/busybox-1.7.0-readlink.patch +107 -0

107 lines not on this page · raw message

Added: trunk/buildroot/package/busybox/busybox-1.7.0-targz_nommu.patch
===================================================================

buildroot/package/busybox/busybox-1.7.0-targz_nommu.patch +282 -0

282 lines not on this page · raw message

Added: trunk/buildroot/package/busybox/busybox-1.7.0-trylink.patch
===================================================================

buildroot/package/busybox/busybox-1.7.0-trylink.patch +89 -0

89 lines not on this page · raw message