From dd4eebcf5e27ca096b5f04ab396cd1c8ee109f4f Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Wed, 14 Jan 2026 13:25:05 -0800 Subject: [PATCH] tftp: Signal that the file system write failed The current behavior when failing to write out a block of data to the storage media is to print an error and return, presumably hoping that once the client retries the "lost" packet there will suddenly be space in the file system. Instead communicate the error to the client, as expected. Signed-off-by: Bjorn Andersson --- tqftpserv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tqftpserv.c b/tqftpserv.c index b17af5e..d4435ce 100644 --- a/tqftpserv.c +++ b/tqftpserv.c @@ -772,8 +772,8 @@ static int handle_writer(struct tftp_client *client) if (block % client->wsize == 0) { ret = write(client->fd, client->rw_buf, client->blk_offset); if (ret < 0) { - /* XXX: report error */ - printf("[TQFTP] failed to write data\n"); + printf("[TQFTP] failed to write data: %s\n", strerror(errno)); + tftp_send_error(client->sock, TFTP_ERROR_ENOSPACE, "Disk full or write error"); return -1; }