From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [patch] udevd - cleanup and better timeout handling
Date: Mon, 02 Feb 2004 11:50:24 +0000 [thread overview]
Message-ID: <20040202115024.GA26377@vrfy.org> (raw)
In-Reply-To: <20040125200314.GA8376@vrfy.org>
[-- Attachment #1: Type: text/plain, Size: 1185 bytes --]
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
[-- Attachment #2: 01-klibc-unix-domain.patch --]
[-- Type: text/plain, Size: 1469 bytes --]
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 <linux/un.h>
+
+#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
[-- Attachment #3: 01-udevsend-klibc.patch --]
[-- Type: text/plain, Size: 1431 bytes --]
===== 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 <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
+#ifdef __KLIBC__
+#include <linux/un.h>
+#else
#include <sys/un.h>
+#endif
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -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
next prev parent reply other threads:[~2004-02-02 11:50 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-25 20:03 [patch] udevd - cleanup and better timeout handling Kay Sievers
2004-01-26 18:22 ` Greg KH
2004-01-26 19:11 ` Kay Sievers
2004-01-26 19:28 ` Greg KH
2004-01-26 19:42 ` Kay Sievers
2004-01-26 22:26 ` Greg KH
2004-01-26 22:56 ` Kay Sievers
2004-01-27 6:56 ` Kay Sievers
2004-01-27 18:55 ` Greg KH
2004-01-27 19:08 ` Kay Sievers
2004-01-27 19:13 ` Greg KH
2004-01-28 21:47 ` Kay Sievers
2004-01-29 1:52 ` Kay Sievers
2004-01-29 1:56 ` Kay Sievers
2004-01-29 15:55 ` Kay Sievers
2004-01-31 2:42 ` Kay Sievers
2004-02-01 9:08 ` Greg KH
2004-02-01 18:16 ` Kay Sievers
2004-02-02 2:19 ` Kay Sievers
2004-02-02 8:21 ` Greg KH
2004-02-02 11:50 ` Kay Sievers [this message]
2004-02-02 18:45 ` Greg KH
2004-02-02 21:36 ` Kay Sievers
2004-02-03 1:26 ` Greg KH
2004-02-03 6:43 ` Ling, Xiaofeng
2004-02-03 20:12 ` Kay Sievers
2004-02-04 0:56 ` Greg KH
2004-02-08 9:43 ` Olaf Hering
2004-02-08 15:22 ` Kay Sievers
2004-02-08 15:40 ` Olaf Hering
2004-02-08 15:57 ` Kay Sievers
2004-02-08 16:09 ` Olaf Hering
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040202115024.GA26377@vrfy.org \
--to=kay.sievers@vrfy.org \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).