summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaehoon.you <jaehoon.you@samsung.com>2013-04-02 20:55:28 +0900
committerjaehoon.you <jaehoon.you@samsung.com>2013-04-02 20:55:28 +0900
commit78e11df57fc16cb63f10e73b3f0427cfef445a3c (patch)
treec8b91fb21ef80f140fc08d5259c835526f14afc4
parenta4129f22b45b945b40fe8487700a119db0485956 (diff)
downloadlthor-78e11df57fc16cb63f10e73b3f0427cfef445a3c.tar.gz
lthor-78e11df57fc16cb63f10e73b3f0427cfef445a3c.tar.bz2
lthor-78e11df57fc16cb63f10e73b3f0427cfef445a3c.zip
Fix and Add some error message
1. In some cases, lthor needs enough memory (Reported by Vyacheslav Barinov in SRR) So, notify message added. 2. fix print format about error message. Change-Id: I42fcea8c21d4183e8909293d2101cebd19ef9dc5 Signed-off-by: jaehoon.you <jaehoon.you@samsung.com>
-rwxr-xr-xlthor.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/lthor.c b/lthor.c
index 27df43d..c6fb121 100755
--- a/lthor.c
+++ b/lthor.c
@@ -897,6 +897,7 @@ int download_pitfile(int fd, const char *pitfile)
if (r < 0) {
fprintf(stderr, "line %d: failed to download %s\n", __LINE__,
pitfile);
+ filedata_close(&filedata);
return r;
}
@@ -927,9 +928,12 @@ int download_single_tarfile(int fd, const char *tarfile)
printf("[\x1b[0;32;1m%s\x1b[0m]\n", filename);
r = download_single_file(fd, &tardata.src, BINARY_TYPE_NORMAL);
if (r < 0) {
- fprintf(stderr, "line %d: failed to download %s\n",
- __LINE__, filename);
- break;
+ fprintf(stderr, "line %d: failed to download %s\n", __LINE__, filename);
+ fprintf(stderr, "\nIn some cases, lthor needs enough memory\n");
+ fprintf(stderr, "Please check free memory in your Host PC ");
+ fprintf(stderr, "and unload some heavy applications\n");
+ tardata_close(&tardata);
+ return r;
}
}
@@ -1001,7 +1005,7 @@ int process_download(const char *portname, const char *pitfile, char **tarfileli
fprintf(stderr, "\nDownload PIT file : %s\n\n", pitfile);
r = download_pitfile(fd, pitfile);
if (r < 0) {
- fprintf(stderr, "failed to download %s\n", pitfile);
+ fprintf(stderr, "\nfailed to download %s\n", pitfile);
close(fd);
return r;
}
@@ -1011,7 +1015,7 @@ int process_download(const char *portname, const char *pitfile, char **tarfileli
fprintf(stderr, "\nDownload files from %s\n\n", *tarfilelist);
r = download_single_tarfile(fd, *tarfilelist);
if (r < 0) {
- fprintf(stderr, "failed to download %s\n", *tarfilelist);
+ fprintf(stderr, "\nfailed to download %s\n", *tarfilelist);
close(fd);
return r;
}