file: call shutdown on socket close

This commit is contained in:
Matheus
2026-07-07 14:38:58 -03:00
parent 5ea6c5423f
commit 196698c059
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -4,6 +4,7 @@
#include <logging.h>
#include <errno.h>
#include <kernel/alloc.h>
#include <kernel/sock.h>
static scache_t *filecache;
#define FILE_HOLD(f) __atomic_add_fetch(&(f)->refcount, 1, __ATOMIC_SEQ_CST)
@@ -179,6 +180,11 @@ int fd_close(int fd) {
MUTEX_RELEASE(&proc->fdmutex);
if (file) {
if (file->vnode && file->vnode->type == V_TYPE_SOCKET) {
socket_t *socket = SOCKFS_SOCKET_FROM_NODE(file->vnode);
socket->ops->shutdown(socket, SOCKET_SHUTDOWN_RW);
}
FILE_RELEASE(file);
}
else {
+1 -1
View File
@@ -1,5 +1,5 @@
name=astral
revision=21
revision=22
from_source=astral
imagedeps="build-essential nasm"
hostdeps="xgcc xbinutils limine"