From 872344c41094f636fd667b9e619f8f219d814605 Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Thu, 5 Feb 2004 01:35:15 -0800 Subject: [PATCH] udevd - switch socket path to abstract namespace As Chris Friesen suggested, here we switch the unix domains socket path to abstract namespace and get rid of the socket file in the filesystem. Hey, this was new to me today. So here a few words: Linux supports a abstract namespace for sockets. We don't need a physical file on the filesystem but only a unique string magically starting with the '\0' character. strace with real file: connect(3, {sa_family=AF_UNIX, path="/udev/.udevd.sock"}, 110) strace with abstract namespace: connect(3, {sa_family=AF_UNIX, path=@udevd}, 110) --- udevsend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'udevsend.c') diff --git a/udevsend.c b/udevsend.c index 9dc2b2e841..223647785d 100644 --- a/udevsend.c +++ b/udevsend.c @@ -161,7 +161,8 @@ int main(int argc, char* argv[]) memset(&saddr, 0x00, sizeof(saddr)); saddr.sun_family = AF_LOCAL; - strcpy(saddr.sun_path, UDEVD_SOCK); + /* use abstract namespace for socket path */ + strcpy(&saddr.sun_path[1], UDEVD_SOCK_PATH); /* try to connect, if it fails start daemon */ retval = connect(sock, (struct sockaddr *) &saddr, sizeof(saddr)); -- cgit v1.2.3