From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Mon, 02 Feb 2004 11:50:24 +0000 Subject: Re: [patch] udevd - cleanup and better timeout handling Message-Id: <20040202115024.GA26377@vrfy.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="gKMricLos+KVdGMg" List-Id: References: <20040125200314.GA8376@vrfy.org> In-Reply-To: <20040125200314.GA8376@vrfy.org> To: linux-hotplug@vger.kernel.org --gKMricLos+KVdGMg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Feb 02, 2004 at 12:21:39AM -0800, Greg KH wrote: > On Mon, Feb 02, 2004 at 03:19:22AM +0100, Kay Sievers wrote: > > > > Same patch with a fix for the stack size setting. > > Nice, applied. > > I also cleaned up the way the logging code works, so that now we can see > what program is spitting out what messages in the syslog. Fine, I've missed it too sometimes. We may include unistd.h for get_pid()? > Also, udevsend can _almost_ be built with klibc. Any reason we have to > use a struct sockaddr_un instead of just a struct sockaddr? If that is > changed than only udevd would rely on glibc. The sockaddr doesn't contain the 108 char long pathname of the socket file. > 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. I have two alternatives attached: 01-udevsend-klibc.patch not the nicest, but it works 01-klibc-unix-domain.patch clean, but touches klibc sources by inserting the missing header file thanks, Kay --gKMricLos+KVdGMg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="01-klibc-unix-domain.patch" diff -Nru a/Makefile b/Makefile --- a/Makefile Mon Feb 2 12:33:54 2004 +++ b/Makefile Mon Feb 2 12:33:54 2004 @@ -161,12 +161,12 @@ 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 -Nru a/klibc/klibc/include/sys/un.h b/klibc/klibc/include/sys/un.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/klibc/klibc/include/sys/un.h Mon Feb 2 12:33:54 2004 @@ -0,0 +1,10 @@ +/* + * sys/un.h + */ + +#ifndef _UN_H +#define _UN_H + +#include + +#endif /* _UN_H */ diff -Nru a/udevsend.c b/udevsend.c --- a/udevsend.c Mon Feb 2 12:33:54 2004 +++ b/udevsend.c Mon Feb 2 12:33:54 2004 @@ -163,7 +163,7 @@ 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 @@ 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 --gKMricLos+KVdGMg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="01-udevsend-klibc.patch" ===== Makefile 1.96 vs edited ===== --- 1.96/Makefile Mon Feb 2 09:19:41 2004 +++ edited/Makefile Mon Feb 2 11:23:22 2004 @@ -161,12 +161,12 @@ 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)" \ ===== udevsend.c 1.12 vs edited ===== --- 1.12/udevsend.c Mon Feb 2 09:29:03 2004 +++ edited/udevsend.c Mon Feb 2 11:15:55 2004 @@ -25,7 +25,11 @@ #include #include #include +#ifdef __KLIBC__ +#include +#else #include +#endif #include #include #include @@ -163,7 +167,7 @@ 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 +186,7 @@ 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 --gKMricLos+KVdGMg-- ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ 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