From 3aa584adcfa3a1ed4292d99e5fa2a6bc578f8b80 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Thu, 22 Oct 2009 01:04:07 -0400
Subject: regex: call memcpy() ourselves

Call the hidden memcpy() ourselves otherwise gcc will emit a call to the
public memcpy() which goes through the PLT.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 libc/misc/regex/regex_old.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'libc/misc')

diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c
index 3550698d3..cbfb7ae7c 100644
--- a/libc/misc/regex/regex_old.c
+++ b/libc/misc/regex/regex_old.c
@@ -8085,7 +8085,8 @@ regexec (
   int len = strlen (string);
   boolean want_reg_info = !preg->no_sub && nmatch > 0;
 
-  private_preg = *preg;
+  /* use hidden memcpy() ourselves rather than gcc calling public memcpy() */
+  memcpy(&private_preg, preg, sizeof(*preg));
 
   private_preg.not_bol = !!(eflags & REG_NOTBOL);
   private_preg.not_eol = !!(eflags & REG_NOTEOL);
-- 
cgit v1.2.3


From 5f37f10508892a4180a1934764dfeb7ce0b1ff19 Mon Sep 17 00:00:00 2001
From: "Peter S. Mazinger" <ps.m@gmx.net>
Date: Sat, 17 Oct 2009 02:04:20 +0200
Subject: assert: make linenumber unsigned

Move attribute_noreturn to header.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
 libc/misc/assert/__assert.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

(limited to 'libc/misc')

diff --git a/libc/misc/assert/__assert.c b/libc/misc/assert/__assert.c
index ff9e47dcf..18c6f5ecf 100644
--- a/libc/misc/assert/__assert.c
+++ b/libc/misc/assert/__assert.c
@@ -29,8 +29,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
-#include <bits/uClibc_uintmaxtostr.h>
 
 
 /* Get the prototype from assert.h as a double-check. */
@@ -43,8 +41,8 @@
 
 static smallint in_assert;			/* bss inits to 0. */
 
-void attribute_noreturn __assert(const char *assertion, const char * filename,
-			  int linenumber, register const char * function)
+void __assert(const char *assertion, const char * filename,
+	      unsigned int linenumber, register const char * function)
 {
 	if (!in_assert) {
 		in_assert = 1;
@@ -62,6 +60,7 @@ void attribute_noreturn __assert(const char *assertion, const char * filename,
 				assertion
 				);
 	}
+	/* shouldn't we? fflush(stderr); */
 	abort();
 }
 
-- 
cgit v1.2.3


From a193e5a08463ea97f55cb66ccd001f156ec7aa87 Mon Sep 17 00:00:00 2001
From: "Peter S. Mazinger" <ps.m@gmx.net>
Date: Sat, 17 Oct 2009 03:36:43 +0200
Subject: msgrcv is of type ssize_t

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
 libc/misc/sysvipc/msgq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'libc/misc')

diff --git a/libc/misc/sysvipc/msgq.c b/libc/misc/sysvipc/msgq.c
index e43a9ed04..dac886f7f 100644
--- a/libc/misc/sysvipc/msgq.c
+++ b/libc/misc/sysvipc/msgq.c
@@ -43,9 +43,9 @@ struct new_msg_buf{
 
 #ifdef L_msgrcv
 #ifdef __NR_msgrcv
-_syscall5(int, msgrcv, int, msqid, void *, msgp, size_t, msgsz, long int, msgtyp, int, msgflg)
+_syscall5(ssize_t, msgrcv, int, msqid, void *, msgp, size_t, msgsz, long int, msgtyp, int, msgflg)
 #else
-int msgrcv (int msqid, void *msgp, size_t msgsz,
+ssize_t msgrcv (int msqid, void *msgp, size_t msgsz,
 	long int msgtyp, int msgflg)
 {
     struct new_msg_buf temp;
-- 
cgit v1.2.3


From 42c91e83ce9ff723105d1c04f05dccf756c9452f Mon Sep 17 00:00:00 2001
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Date: Fri, 20 Nov 2009 09:37:56 +0100
Subject: __assert: include unistd.h for smallint

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
 libc/misc/assert/__assert.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

(limited to 'libc/misc')

diff --git a/libc/misc/assert/__assert.c b/libc/misc/assert/__assert.c
index 18c6f5ecf..8afde52ff 100644
--- a/libc/misc/assert/__assert.c
+++ b/libc/misc/assert/__assert.c
@@ -29,7 +29,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-
+#include <unistd.h>
 
 /* Get the prototype from assert.h as a double-check. */
 #undef NDEBUG
@@ -63,5 +63,4 @@ void __assert(const char *assertion, const char * filename,
 	/* shouldn't we? fflush(stderr); */
 	abort();
 }
-
 libc_hidden_def(__assert)
-- 
cgit v1.2.3