Merge pull request #34675 from poettering/dupfd-query

fd-util: use F_DUPFD_QUERY for same_fd()
This commit is contained in:
Luca Boccassi
2024-10-08 19:30:57 +01:00
committed by GitHub
6 changed files with 105 additions and 33 deletions
+4 -1
View File
@@ -400,9 +400,12 @@ _public_ int sd_is_socket_unix(int fd, int type, int listening, const char *path
_public_ int sd_is_mq(int fd, const char *path) {
struct mq_attr attr;
int r;
/* Check that the fd is valid */
assert_return(fcntl(fd, F_GETFD) >= 0, -errno);
r = fd_validate(fd);
if (r < 0)
return r;
if (mq_getattr(fd, &attr) < 0) {
if (errno == EBADF)