diff mbox series

Fix (one more) usage of TMPDIR

Message ID 20170912114910.15684-1-christian.storm@siemens.com
State Rejected
Headers show
Series Fix (one more) usage of TMPDIR | expand

Commit Message

Storm, Christian Sept. 12, 2017, 11:49 a.m. UTC
Fix one more spot that uses the TMPDIR variable.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 handlers/flash_hamming1_handler.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Stefano Babic Sept. 12, 2017, 11:54 a.m. UTC | #1
On 12/09/2017 13:49, Christian Storm wrote:
> Fix one more spot that uses the TMPDIR variable.
> 
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>  handlers/flash_hamming1_handler.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/handlers/flash_hamming1_handler.c b/handlers/flash_hamming1_handler.c
> index 44141fd..8b54d3a 100644
> --- a/handlers/flash_hamming1_handler.c
> +++ b/handlers/flash_hamming1_handler.c
> @@ -294,6 +294,7 @@ static int install_flash_hamming_image(struct img_type *img,
>  	char filename[64];
>  	int mtdnum;
>  	int n;
> +	const char* TMPDIR = get_tmpdir();
>  
>  	n = snprintf(filename, sizeof(filename), "%s%s", TMPDIR, img->fname);
>  	if (n < 0 || n >= sizeof(filename)) {
> 


mmmhh...ok, then I send V3 of my patch with this one.

It looks like we have an issue with Travis, because it was not reported
that a build failed.

Regards,
Stefano
Storm, Christian Sept. 12, 2017, 12:13 p.m. UTC | #2
Hi Stefano,

> [...]
> It looks like we have an issue with Travis, because it was not reported
> that a build failed.

Travis reported this https://travis-ci.org/sbabic/swupdate#L1497
but the last config (configs/without_lua_defconfig) compiled successfully,
hence the "return" value of the whole loop was 0, i.e., OK.
Maybe an || exit 1 would help here...

Kind regards,
   Christian
Stefano Babic Sept. 12, 2017, 12:25 p.m. UTC | #3
On 12/09/2017 14:13, Christian Storm wrote:
> Hi Stefano,
> 
>> [...]
>> It looks like we have an issue with Travis, because it was not reported
>> that a build failed.
> 
> Travis reported this https://travis-ci.org/sbabic/swupdate#L1497
> but the last config (configs/without_lua_defconfig) compiled successfully,
> hence the "return" value of the whole loop was 0, i.e., OK.
> Maybe an || exit 1 would help here...

Exactly - do you send the patch ?

Stefano
Storm, Christian Sept. 12, 2017, 12:44 p.m. UTC | #4
Hi Stefano,


> >> [...]
> >> It looks like we have an issue with Travis, because it was not reported
> >> that a build failed.
> > 
> > Travis reported this https://travis-ci.org/sbabic/swupdate#L1497
> > but the last config (configs/without_lua_defconfig) compiled successfully,
> > hence the "return" value of the whole loop was 0, i.e., OK.
> > Maybe an || exit 1 would help here...
> 
> Exactly - do you send the patch ?

Yes, will do in a moment. I'm currently testing it to be on the safe side :)


Kind regards,
   Christian
diff mbox series

Patch

diff --git a/handlers/flash_hamming1_handler.c b/handlers/flash_hamming1_handler.c
index 44141fd..8b54d3a 100644
--- a/handlers/flash_hamming1_handler.c
+++ b/handlers/flash_hamming1_handler.c
@@ -294,6 +294,7 @@  static int install_flash_hamming_image(struct img_type *img,
 	char filename[64];
 	int mtdnum;
 	int n;
+	const char* TMPDIR = get_tmpdir();
 
 	n = snprintf(filename, sizeof(filename), "%s%s", TMPDIR, img->fname);
 	if (n < 0 || n >= sizeof(filename)) {