Skip to content

Commit a4fdd2c

Browse files
rlubosdanieldegrasse
authored andcommitted
net: sockets: socketpair: Fix close function type
socketpair fd regsiters ZVFS_MODE_IFSOCK therefore it should register a close2() function instead of close(). Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
1 parent 82945a7 commit a4fdd2c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

subsys/net/lib/sockets/socketpair.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,11 +1161,13 @@ static int spair_setsockopt(void *obj, int level, int optname,
11611161
return -1;
11621162
}
11631163

1164-
static int spair_close(void *obj)
1164+
static int spair_close(void *obj, int fd)
11651165
{
11661166
struct spair *const spair = (struct spair *)obj;
11671167
int res;
11681168

1169+
ARG_UNUSED(fd);
1170+
11691171
res = k_sem_take(&spair->sem, K_FOREVER);
11701172
__ASSERT(res == 0, "failed to take local sem: %d", res);
11711173

@@ -1181,7 +1183,7 @@ static const struct socket_op_vtable spair_fd_op_vtable = {
11811183
.fd_vtable = {
11821184
.read = spair_read,
11831185
.write = spair_write,
1184-
.close = spair_close,
1186+
.close2 = spair_close,
11851187
.ioctl = spair_ioctl,
11861188
},
11871189
.bind = spair_bind,

0 commit comments

Comments
 (0)