summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--udevd.c6
-rw-r--r--udevd.h1
-rw-r--r--udevsend.c3
4 files changed, 5 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 618adad71e..35575806db 100644
--- a/Makefile
+++ b/Makefile
@@ -241,7 +241,6 @@ udev_version.h:
@echo \#define UDEV_PERMISSION_FILE \"$(configdir)\udev.permissions\" >> $@
@echo \#define UDEV_BIN \"$(DESTDIR)$(sbindir)/udev\" >> $@
@echo \#define UDEVD_BIN \"$(DESTDIR)$(sbindir)/udevd\" >> $@
- @echo \#define UDEVD_SOCK \"$(udevdir)/\.udevd.sock\" >> $@
@echo \#define UDEVD_LOCK \"$(udevdir)/\.udevd.lock\" >> $@
# config files automatically generated
diff --git a/udevd.c b/udevd.c
index f8b8c27ee4..24cf9c9a7c 100644
--- a/udevd.c
+++ b/udevd.c
@@ -325,7 +325,6 @@ static void sig_handler(int signum)
case SIGINT:
case SIGTERM:
unlink(UDEVD_LOCK);
- unlink(UDEVD_SOCK);
exit(20 + signum);
break;
default:
@@ -378,9 +377,9 @@ 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);
- unlink(UDEVD_SOCK);
ssock = socket(AF_LOCAL, SOCK_STREAM, 0);
if (ssock == -1) {
dbg("error getting socket");
@@ -426,6 +425,5 @@ int main(int argc, char *argv[])
}
exit:
close(ssock);
- unlink(UDEVD_SOCK);
exit(1);
}
diff --git a/udevd.h b/udevd.h
index 6dbee3a295..8efe1d569c 100644
--- a/udevd.h
+++ b/udevd.h
@@ -27,6 +27,7 @@
#define UDEV_MAGIC "udevd_" UDEV_VERSION
#define EVENT_TIMEOUT_SEC 5
#define UDEVSEND_CONNECT_RETRY 20 /* x 100 millisec */
+#define UDEVD_SOCK_PATH "udevd"
struct hotplug_msg {
char magic[20];
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));