summaryrefslogtreecommitdiffstats
path: root/fs/tftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/tftp.c')
-rw-r--r--fs/tftp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/tftp.c b/fs/tftp.c
index f86a7d1b0f..50efe0d77c 100644
--- a/fs/tftp.c
+++ b/fs/tftp.c
@@ -598,7 +598,10 @@ static int tftp_stat(struct device_d *dev, const char *filename, struct stat *s)
return PTR_ERR(priv);
s->st_mode = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO;
- s->st_size = priv->filesize;
+ if (priv->filesize)
+ s->st_size = priv->filesize;
+ else
+ s->st_size = FILESIZE_MAX;
tftp_do_close(priv);