chiark / gitweb /
[PATCH] let udevsend build with klibc
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Tue, 3 Feb 2004 02:10:29 +0000 (18:10 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:13:20 +0000 (21:13 -0700)
> I don't mind udevd using glibc, I just want the programs that get run a
> lot of different times (udev and udevsend) to be as small as possible to
> get the best cache results.  As udevd sticks around all the time, it's
> not as important.  Sound sane to you?

Oh, nice. Good idea.

Makefile
klibc/klibc/include/sys/un.h [new file with mode: 0644]
udevsend.c

index 386583b7ebb41f1a8fe7aa904aca41ec12bcf87b..dd2f697591dfcb452672c4e1ec8ff6cf36a08876 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -161,12 +161,12 @@ else
        CFLAGS += $(WARNINGS) -I$(GCCINCDIR)
        LIB_OBJS = -lc
        LDFLAGS =
-       UDEVD = $(DAEMON) $(SENDER)
+       UDEVD = $(DAEMON)
 endif
 
 CFLAGS += -I$(PWD)/libsysfs
 
-all: $(ROOT) $(UDEVD) $(HELPER)
+all: $(ROOT) $(SENDER) $(UDEVD) $(HELPER)
        @extras="$(EXTRAS)" ; for target in $$extras ; do \
                echo $$target ; \
                $(MAKE) prefix=$(prefix) LD="$(LD)" SYSFS="$(SYSFS)" \
diff --git a/klibc/klibc/include/sys/un.h b/klibc/klibc/include/sys/un.h
new file mode 100644 (file)
index 0000000..85822ba
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+ * sys/un.h
+ */
+
+#ifndef _UN_H
+#define _UN_H
+
+#include <linux/un.h>
+
+#endif /* _UN_H */
index 415207d8ca26d8108a90d17cff7b83a93abdaf5c..fd61cb2a2ff989c72c142cf85cbd18b889548ebb 100644 (file)
@@ -163,7 +163,7 @@ int main(int argc, char* argv[])
        strcpy(saddr.sun_path, UDEVD_SOCK);
 
        /* try to connect, if it fails start daemon */
-       retval = connect(sock, &saddr, sizeof(saddr));
+       retval = connect(sock, (struct sockaddr *) &saddr, sizeof(saddr));
        if (retval != -1) {
                goto send;
        } else {
@@ -182,7 +182,7 @@ int main(int argc, char* argv[])
        tspec.tv_nsec = 100000000;  /* 100 millisec */
        loop = UDEVSEND_CONNECT_RETRY;
        while (loop--) {
-               retval = connect(sock, &saddr, sizeof(saddr));
+               retval = connect(sock, (struct sockaddr *) &saddr, sizeof(saddr));
                if (retval != -1)
                        goto send;
                else