[OE-core] [PATCH 1/1] rsync:Use usleep() for msleep() if it is available

Chen Qi Qi.Chen at windriver.com
Wed Oct 28 06:41:16 UTC 2015


Use usleep() for msleep() if it is available.

Upstreamlink:https://git.samba.org/?p=rsync.git;a=
commitdiff;h=5546dab32970955e77ef7a5886bcd8fb765a25bf

Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
---
 ...rsync-use-usleep-for-msleep-when-possible.patch | 55 ++++++++++++++++++++++
 meta/recipes-devtools/rsync/rsync.inc              |  3 +-
 2 files changed, 57 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/rsync/files/0001-rsync-use-usleep-for-msleep-when-possible.patch

diff --git a/meta/recipes-devtools/rsync/files/0001-rsync-use-usleep-for-msleep-when-possible.patch b/meta/recipes-devtools/rsync/files/0001-rsync-use-usleep-for-msleep-when-possible.patch
new file mode 100644
index 0000000..ad54add
--- /dev/null
+++ b/meta/recipes-devtools/rsync/files/0001-rsync-use-usleep-for-msleep-when-possible.patch
@@ -0,0 +1,55 @@
+Upstream-Status: Pending
+
+Subject: rsync: use usleep() for msleep() when possible
+
+This patch refers to https://git.samba.org/?p=rsync.git;a=commitdiff;h=5546dab32970955e77ef7a5886bcd8fb765a25b
+
+Signed-off-by: Hu Yadi <Yadi.Hu at windriver.com>
+Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
+---
+ configure.ac | 2 +-
+ util2.c      | 7 ++++++-
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index cf588ce..12e0dba 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -602,7 +602,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
+     setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
+     seteuid strerror putenv iconv_open locale_charset nl_langinfo getxattr \
+     extattr_get_link sigaction sigprocmask setattrlist getgrouplist \
+-    initgroups utimensat posix_fallocate attropen setvbuf)
++    initgroups utimensat posix_fallocate attropen setvbuf usleep)
+ 
+ dnl cygwin iconv.h defines iconv_open as libiconv_open
+ if test x"$ac_cv_func_iconv_open" != x"yes"; then
+diff --git a/util2.c b/util2.c
+index 6ffbcec..73cb736 100644
+--- a/util2.c
++++ b/util2.c
+@@ -35,6 +35,9 @@ extern int checksum_len;
+  **/
+ int msleep(int t)
+ {
++#ifdef HAVE_USLEEP
++	usleep(t*1000);
++#else
+ 	int tdiff = 0;
+ 	struct timeval tval, t1, t2;
+ 
+@@ -52,8 +55,10 @@ int msleep(int t)
+ 			t1 = t2; /* Time went backwards, so start over. */
+ 		tdiff = (t2.tv_sec - t1.tv_sec)*1000 +
+ 			(t2.tv_usec - t1.tv_usec)/1000;
++		if (tdiff < 0)
++			t1 = t2; /* Time went backwards, so start over. */
+ 	}
+-
++#endif
+ 	return True;
+ }
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/rsync/rsync.inc b/meta/recipes-devtools/rsync/rsync.inc
index c65f270..b250367 100644
--- a/meta/recipes-devtools/rsync/rsync.inc
+++ b/meta/recipes-devtools/rsync/rsync.inc
@@ -11,7 +11,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 DEPENDS = "popt"
 
 SRC_URI = "http://rsync.samba.org/ftp/rsync/src/rsync-${PV}.tar.gz \
-           file://rsyncd.conf"
+           file://rsyncd.conf \
+           file://0001-rsync-use-usleep-for-msleep-when-possible.patch"
 
 inherit autotools
 
-- 
1.9.1




More information about the Openembedded-core mailing list