mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
tree-wide: replace AF_LOCAL with AF_UNIX
This commit is contained in:
committed by
Luca Boccassi
parent
bf7a24e50f
commit
618b3642e1
@@ -403,7 +403,7 @@ static int bus_socket_set_transient_property(
|
||||
if (p->address.type < 0)
|
||||
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid address type: %s", t);
|
||||
|
||||
if (socket_address_family(&p->address) != AF_LOCAL && p->address.type == SOCK_SEQPACKET)
|
||||
if (socket_address_family(&p->address) != AF_UNIX && p->address.type == SOCK_SEQPACKET)
|
||||
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Address family not supported: %s", a);
|
||||
}
|
||||
|
||||
|
||||
@@ -644,7 +644,7 @@ int config_parse_socket_listen(
|
||||
p->address.type = SOCK_SEQPACKET;
|
||||
}
|
||||
|
||||
if (socket_address_family(&p->address) != AF_LOCAL && p->address.type == SOCK_SEQPACKET) {
|
||||
if (socket_address_family(&p->address) != AF_UNIX && p->address.type == SOCK_SEQPACKET) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, 0, "Address family not supported, ignoring: %s", rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ static void test_byname(void *handle, const char *module, const char *name) {
|
||||
puts("");
|
||||
test_gethostbyname3_r(handle, module, name, AF_UNSPEC);
|
||||
puts("");
|
||||
test_gethostbyname3_r(handle, module, name, AF_LOCAL);
|
||||
test_gethostbyname3_r(handle, module, name, AF_UNIX);
|
||||
puts("");
|
||||
|
||||
test_gethostbyname2_r(handle, module, name, AF_INET);
|
||||
@@ -333,7 +333,7 @@ static void test_byname(void *handle, const char *module, const char *name) {
|
||||
puts("");
|
||||
test_gethostbyname2_r(handle, module, name, AF_UNSPEC);
|
||||
puts("");
|
||||
test_gethostbyname2_r(handle, module, name, AF_LOCAL);
|
||||
test_gethostbyname2_r(handle, module, name, AF_UNIX);
|
||||
puts("");
|
||||
|
||||
test_gethostbyname_r(handle, module, name);
|
||||
|
||||
@@ -53,7 +53,7 @@ int udev_ctrl_new_from_fd(UdevCtrl **ret, int fd) {
|
||||
assert(ret);
|
||||
|
||||
if (fd < 0) {
|
||||
sock = socket(AF_LOCAL, SOCK_SEQPACKET|SOCK_NONBLOCK|SOCK_CLOEXEC, 0);
|
||||
sock = socket(AF_UNIX, SOCK_SEQPACKET|SOCK_NONBLOCK|SOCK_CLOEXEC, 0);
|
||||
if (sock < 0)
|
||||
return log_error_errno(errno, "Failed to create socket: %m");
|
||||
}
|
||||
|
||||
@@ -1661,7 +1661,7 @@ static int listen_fds(int *ret_ctrl, int *ret_netlink) {
|
||||
return n;
|
||||
|
||||
for (fd = SD_LISTEN_FDS_START; fd < n + SD_LISTEN_FDS_START; fd++) {
|
||||
if (sd_is_socket(fd, AF_LOCAL, SOCK_SEQPACKET, -1) > 0) {
|
||||
if (sd_is_socket(fd, AF_UNIX, SOCK_SEQPACKET, -1) > 0) {
|
||||
if (ctrl_fd >= 0)
|
||||
return -EINVAL;
|
||||
ctrl_fd = fd;
|
||||
@@ -1979,7 +1979,7 @@ static int main_loop(Manager *manager) {
|
||||
manager->pid = getpid_cached();
|
||||
|
||||
/* unnamed socket from workers to the main daemon */
|
||||
r = socketpair(AF_LOCAL, SOCK_DGRAM|SOCK_CLOEXEC, 0, manager->worker_watch);
|
||||
r = socketpair(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0, manager->worker_watch);
|
||||
if (r < 0)
|
||||
return log_error_errno(errno, "Failed to create socketpair for communicating with workers: %m");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user