diff options
author | zhangxiao <xiao.zhang@windriver.com> | 2014-09-04 17:40:17 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2014-09-26 05:41:54 +0200 |
commit | ed698c4dba606b9d0c36c68023004046417db251 (patch) | |
tree | 402099fa5dd6ca3c01d7c6fcaabaf36103a93f0c | |
parent | 01816e442076afa820cbccbfd67a7b3fa382199d (diff) | |
download | meta-openembedded-ed698c4dba606b9d0c36c68023004046417db251.tar.gz |
tftp-hpa: bug fix on empty file put error
With the feature that checking the disk filled up, the return value of
function write_behind was checked and used to detect the disk status.
While for empty file, without data being written, this function will
return -1 thus the disk filled up error was miss-raised. Fix it.
Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r-- | meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-empty-file-put-error.patch | 33 | ||||
-rw-r--r-- | meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-empty-file-put-error.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-empty-file-put-error.patch new file mode 100644 index 0000000000..aa29d9ce1c --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-empty-file-put-error.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | tftp-hpa: bug fix on empty file put error | ||
2 | |||
3 | With the feature that checking the disk filled up, the return value of | ||
4 | function write_behind was checked and used to detect the disk status. | ||
5 | While for empty file, without data being written, this function will | ||
6 | return -1 thus the disk filled up error was miss-raised. Fix it. | ||
7 | |||
8 | Upstream-Status: pending | ||
9 | |||
10 | Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com> | ||
11 | --- | ||
12 | tftpd/tftpd.c | 4 ++-- | ||
13 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
14 | --- a/tftpd/tftpd.c | ||
15 | +++ b/tftpd/tftpd.c | ||
16 | @@ -1692,7 +1692,7 @@ static void tftp_recvfile(const struct f | ||
17 | syslog(LOG_WARNING, "tftpd: write(ack): %m"); | ||
18 | goto abort; | ||
19 | } | ||
20 | - if(write_behind(file, pf->f_convert) < 0) { | ||
21 | + if(write_behind(file, pf->f_convert) < -1) { | ||
22 | nak(ENOSPACE, NULL); | ||
23 | (void)fclose(file); | ||
24 | goto abort; | ||
25 | @@ -1727,7 +1727,7 @@ static void tftp_recvfile(const struct f | ||
26 | goto abort; | ||
27 | } | ||
28 | } while (size == segsize); | ||
29 | - if(write_behind(file, pf->f_convert) < 0) { | ||
30 | + if(write_behind(file, pf->f_convert) < -1) { | ||
31 | nak(ENOSPACE, NULL); | ||
32 | (void)fclose(file); | ||
33 | goto abort; | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb index 19517473fe..e58a4b1851 100644 --- a/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb +++ b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb | |||
@@ -25,6 +25,7 @@ SRC_URI = "http://kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-${PV}.t | |||
25 | file://init \ | 25 | file://init \ |
26 | file://add-error-check-for-disk-filled-up.patch \ | 26 | file://add-error-check-for-disk-filled-up.patch \ |
27 | file://tftp-hpa-bug-fix-on-separated-CR-and-LF.patch \ | 27 | file://tftp-hpa-bug-fix-on-separated-CR-and-LF.patch \ |
28 | file://tftp-hpa-bug-fix-on-empty-file-put-error.patch \ | ||
28 | " | 29 | " |
29 | 30 | ||
30 | SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21" | 31 | SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21" |