mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-18 15:30:21 +00:00
* Open permissions on /var/run/devd.pipe so that any user can read devd events
from this socket * Enable non-blocking I/O on devd.pipe to keep clients from wedging devd. If a write(2) on devd.pipe would block, the client in question will be removed [1] Requested by: rwatson [1] Approved by: imp
This commit is contained in:
parent
8381892977
commit
e60fa01486
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=147973
@ -672,11 +672,13 @@ create_socket(const char *name)
|
||||
strlcpy(sun.sun_path, name, sizeof(sun.sun_path));
|
||||
slen = SUN_LEN(&sun);
|
||||
unlink(name);
|
||||
if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
|
||||
err(1, "fcntl");
|
||||
if (bind(fd, (struct sockaddr *) & sun, slen) < 0)
|
||||
err(1, "bind");
|
||||
listen(fd, 4);
|
||||
chown(name, 0, 0); /* XXX - root.wheel */
|
||||
chmod(name, 0660);
|
||||
chmod(name, 0666);
|
||||
return (fd);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user