summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy.Li <rongqing.li@windriver.com>2014-10-17 13:24:24 +0800
committerJoe MacDonald <joe_macdonald@mentor.com>2014-10-21 14:54:11 -0400
commit4cc73f63aa5fa4e1883be9114c3a992e2266ee60 (patch)
tree1b1963b4d01155a160984287a05e7ba9a2fad52a
parent15ccbddc6db99689548b518160ad26e1bdc37261 (diff)
downloadmeta-openembedded-4cc73f63aa5fa4e1883be9114c3a992e2266ee60.tar.gz
tftp-hpa: fix the empty file writing error
make write_behind to return 0 if a empty file is written, to distinguish a true writing failure[on which the write_behind will return -1], then the annoying wrong log will disappear. ____ |Error code 3: Disk full or allocation exceeded ----- Signed-off-by: Roy.Li <rongqing.li@windriver.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch39
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb1
2 files changed, 40 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch b/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch
new file mode 100644
index 0000000000..452aa05f81
--- /dev/null
+++ b/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch
@@ -0,0 +1,39 @@
1[PATCH] fix the empty file writting
2
3Upstream-Status: pending
4
5With the feature that checking the disk filled up, the return
6value of function write_behind was checked and used to detect
7the disk status. While for empty file, without data being
8written, this function will return -1 thus the disk filled up
9error was miss-raised.
10
11make write_behind to return 0 if written file is empty, to fix
12the this bug.
13
14Signed-off-by: Roy.Li <rongqing.li@windriver.com>
15---
16 common/tftpsubs.c | 5 ++++-
17 1 file changed, 4 insertions(+), 1 deletion(-)
18
19diff --git a/common/tftpsubs.c b/common/tftpsubs.c
20index b4ea3f2..9f6cafc 100644
21--- a/common/tftpsubs.c
22+++ b/common/tftpsubs.c
23@@ -198,9 +198,12 @@ int write_behind(FILE * file, int convert)
24 nextone = !nextone; /* incr for next time */
25 buf = dp->th_data;
26
27- if (count <= 0)
28+ if (count < 0)
29 return -1; /* nak logic? */
30
31+ if (count == 0)
32+ return 0;
33+
34 if (convert == 0)
35 return write(fileno(file), buf, count);
36
37--
381.9.1
39
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..3f17fd6fc2 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://fix-writing-emtpy-file.patch \
28" 29"
29 30
30SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21" 31SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21"