From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Fri, 17 Sep 2004 19:11:34 +0000 Subject: latest klibc for udev Message-Id: <20040917191134.GA28506@vrfy.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="IJpNTDwzlM2Ie8A6" List-Id: To: linux-hotplug@vger.kernel.org --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline This patch make it possible to run udev with the latest klibc. One patch for the udev/Makefile to match the moved include/ dir. Another one for klibc's string fuctions, that are causing segfaults: strncpy.c: the while() gets n == -1 and memset() dies strncat.c: cat's only strlen(dest) count of chars from src to dest Thanks, Kay --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="udev-klibc-last-01.patch" ===== Makefile 1.169 vs edited ===== --- 1.169/Makefile 2004-09-14 07:55:07 +02:00 +++ edited/Makefile 2004-09-17 18:47:26 +02:00 @@ -140,7 +140,7 @@ ifeq ($(strip $(USE_KLIBC)),true) KLIBC_BASE = $(PWD)/klibc KLIBC_DIR = $(KLIBC_BASE)/klibc - INCLUDE_DIR := $(KLIBC_DIR)/include + INCLUDE_DIR := $(KLIBC_BASE)/include LINUX_INCLUDE_DIR := $(KERNEL_DIR)/include # LINUX_INCLUDE_DIR := $(KLIBC_BASE)/linux/include include $(KLIBC_DIR)/arch/$(ARCH)/MCONFIG @@ -155,7 +155,7 @@ $(OPTFLAGS) \ -D__KLIBC__ -fno-builtin-printf \ -I$(INCLUDE_DIR) \ - -I$(KLIBC_DIR)/arch/$(ARCH)/include \ + -I$(INCLUDE_DIR)/arch/$(ARCH) \ -I$(INCLUDE_DIR)/bits$(BITSIZE) \ -I$(GCCINCDIR) \ -I$(LINUX_INCLUDE_DIR) --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="klibc-bug-01.patch" --- ../klibc-0.177/klibc/strncpy.c 2004-08-26 08:03:41.000000000 +0200 +++ klibc/klibc/strncpy.c 2004-09-17 19:07:28.936701652 +0200 @@ -10,7 +10,8 @@ char *strncpy(char *dst, const char *src const char *p = src; char ch; - while ( n-- ) { + while (n) { + n--; *q++ = ch = *p++; if ( !ch ) break; --- ../klibc-0.177/klibc/strncat.c 2004-08-26 08:03:41.000000000 +0200 +++ klibc/klibc/strncat.c 2004-09-17 21:02:33.004357774 +0200 @@ -8,13 +8,18 @@ char *strncat(char *dst, const char *src, size_t n) { char *q = strchr(dst, '\0'); + const char *p = src; + char ch; size_t nn = q-dst; if ( __likely(nn <= n) ) - n = nn; + n -= nn; - memcpy(q, src, n); - q[n] = '\0'; + while (n--) { + *q++ = ch = *p++; + if ( !ch ) + break; + } return dst; } --IJpNTDwzlM2Ie8A6-- ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel