]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fileio: propagate original error if we notice AF_UNIX connect() is not going to work
authorLennart Poettering <lennart@poettering.net>
Tue, 10 May 2022 14:22:16 +0000 (16:22 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 13 May 2022 12:48:17 +0000 (21:48 +0900)
let's not make up new errors in these checks that validate if connect()
work at all. After all, we don't really know if the ENXIO we saw earlier
actually is really caused by the inode being an AF_UNIX socket, we just
have the suspicion...

src/basic/fileio.c

index e7b670ab2e4528b085f31efc725b4f1ac7b37bc7..1483c762280dca83e64262ace0425d4c1be0bf01 100644 (file)
@@ -776,7 +776,7 @@ int read_full_file_full(
 
                 /* Seeking is not supported on AF_UNIX sockets */
                 if (offset != UINT64_MAX)
-                        return -ESPIPE;
+                        return -ENXIO;
 
                 if (dir_fd == AT_FDCWD)
                         r = sockaddr_un_set_path(&sa.un, filename);