From 1056c759fdebf8361df71691a201834aeb6fcc20 Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Wed, 27 Mar 2024 15:42:53 +0100 Subject: [PATCH] vfs_lxip: propagate data file write error All errors (as in the legacy version) are now propagated as WRITE_ERR_IO (see Lxip_vfs_file_handle::write), which ultimately will lead to EPIPE in libc's socket_fs. This also counts for EAGAIN leading to the fact that partial writes are not supported for blocking sockets in libc, also libc will not try a second time in case not all data has been written. issue #5165 --- repos/dde_linux/src/lib/vfs/lxip/vfs.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/repos/dde_linux/src/lib/vfs/lxip/vfs.cc b/repos/dde_linux/src/lib/vfs/lxip/vfs.cc index 443806c2df..01deb5fa16 100644 --- a/repos/dde_linux/src/lib/vfs/lxip/vfs.cc +++ b/repos/dde_linux/src/lib/vfs/lxip/vfs.cc @@ -475,7 +475,12 @@ class Vfs::Lxip_data_file final : public Vfs::Lxip_file _write_err = genode_socket_sendmsg(&_sock, msg_send.header(), &bytes_sent); - return bytes_sent; + /* TODO: propagate EAGAIN + if (_write_err == GENODE_EAGAIN) + throw Would_block(); + */ + + return _write_err == GENODE_ENONE ? bytes_sent : -1; } long read(Lxip_vfs_file_handle &,