projects
/
project
/
procd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix behaviour during sysupgrade
[project/procd.git]
/
hotplug.c
diff --git
a/hotplug.c
b/hotplug.c
index
6583de4
..
f7e2ce9
100644
(file)
--- a/
hotplug.c
+++ b/
hotplug.c
@@
-422,13
+422,11
@@
void hotplug(char *rules)
nls.nl_groups = -1;
if ((hotplug_fd.fd = socket(PF_NETLINK, SOCK_DGRAM | SOCK_CLOEXEC, NETLINK_KOBJECT_UEVENT)) == -1) {
nls.nl_groups = -1;
if ((hotplug_fd.fd = socket(PF_NETLINK, SOCK_DGRAM | SOCK_CLOEXEC, NETLINK_KOBJECT_UEVENT)) == -1) {
- ERROR("Failed to open hotplug socket\n");
- perror("socket");
+ ERROR("Failed to open hotplug socket: %s\n", strerror(errno));
exit(1);
}
if (bind(hotplug_fd.fd, (void *)&nls, sizeof(struct sockaddr_nl))) {
exit(1);
}
if (bind(hotplug_fd.fd, (void *)&nls, sizeof(struct sockaddr_nl))) {
- ERROR("Failed to bind hotplug socket\n");
- perror("socket");
+ ERROR("Failed to bind hotplug socket: %s\n", strerror(errno));
exit(1);
}
exit(1);
}
@@
-436,3
+434,9
@@
void hotplug(char *rules)
queue_proc.cb = queue_proc_cb;
uloop_fd_add(&hotplug_fd, ULOOP_READ);
}
queue_proc.cb = queue_proc_cb;
uloop_fd_add(&hotplug_fd, ULOOP_READ);
}
+
+void hotplug_shutdown(void)
+{
+ uloop_fd_delete(&hotplug_fd);
+ close(hotplug_fd.fd);
+}