]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: replace AF_LOCAL with AF_UNIX
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 14 May 2022 06:27:17 +0000 (15:27 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 14 May 2022 09:51:05 +0000 (10:51 +0100)
src/core/dbus-socket.c
src/core/load-fragment.c
src/test/test-nss-hosts.c
src/udev/udev-ctrl.c
src/udev/udevd.c

index d1e0509e55d69686b8a4b1d42615a0dd77e27295..43edbb60e4bf60afe8616cbc25bb90447d76091b 100644 (file)
@@ -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);
                         }
 
index 74c41335caefe5f00c48071c9022347a3e887e08..dc599aa855dea774bd037e4445a352f556713680 100644 (file)
@@ -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;
                 }
index 7b2bea4f647cf264dc05b806802eecff9f35055e..c361df1632bb0e568c964a720c7e07196e2f6363 100644 (file)
@@ -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);
index 528641d956375bfd5c09dfd33e47b90f335fcefe..cb71dc09291f33b18cfeb82b4c9ec702ed31cb0e 100644 (file)
@@ -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");
         }
index d140dcf6f648137b40d89956b35ff91975adb48f..478db198aced4ffe356a9394ecae678f46c82955 100644 (file)
@@ -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");