mirror of
https://github.com/linux-msm/tqftpserv.git
synced 2026-02-25 13:12:17 -08:00
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 <bjorn.andersson@oss.qualcomm.com>
This commit is contained in:
committed by
Bjorn Andersson
parent
477f031648
commit
dd4eebcf5e
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user