mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] fastboot: Use make_temp() to create temporary file
@ 2020-06-17  5:11 Sascha Hauer
  2020-06-17  5:11 ` [PATCH 2/2] fastboot: Drop support for downloading to buffer Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2020-06-17  5:11 UTC (permalink / raw)
  To: Barebox List

make_temp() was created for this purpose, so use it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/fastboot.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/fastboot.c b/common/fastboot.c
index 6f54e939e7..c32b0a0e77 100644
--- a/common/fastboot.c
+++ b/common/fastboot.c
@@ -176,7 +176,6 @@ int fastboot_generic_init(struct fastboot *fb, bool export_bbu)
 	int ret;
 	struct file_list_entry *fentry;
 	struct fb_variable *var;
-	static int instance;
 
 	var = fb_addvar(fb, "version");
 	fb_setvar(var, "0.4");
@@ -187,7 +186,9 @@ int fastboot_generic_init(struct fastboot *fb, bool export_bbu)
 		fb_setvar(var, "%u", fastboot_max_download_size);
 	}
 
-	fb->tempname = basprintf(".fastboot.%d.img", instance++);
+	fb->tempname = make_temp("fastboot");
+	if (!fb->tempname)
+		return -ENOMEM;
 
 	if (IS_ENABLED(CONFIG_BAREBOX_UPDATE) && export_bbu)
 		bbu_handlers_iterate(fastboot_add_bbu_variables, fb);
-- 
2.27.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH 1/2] fastboot: Use make_temp() to create temporary file
@ 2020-06-15  6:08 Sascha Hauer
  2020-06-15  6:08 ` [PATCH 2/2] fastboot: Drop support for downloading to buffer Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2020-06-15  6:08 UTC (permalink / raw)
  To: Barebox List

make_temp() was created for this purpose, so use it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/fastboot.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/fastboot.c b/common/fastboot.c
index 6f54e939e7..c32b0a0e77 100644
--- a/common/fastboot.c
+++ b/common/fastboot.c
@@ -176,7 +176,6 @@ int fastboot_generic_init(struct fastboot *fb, bool export_bbu)
 	int ret;
 	struct file_list_entry *fentry;
 	struct fb_variable *var;
-	static int instance;
 
 	var = fb_addvar(fb, "version");
 	fb_setvar(var, "0.4");
@@ -187,7 +186,9 @@ int fastboot_generic_init(struct fastboot *fb, bool export_bbu)
 		fb_setvar(var, "%u", fastboot_max_download_size);
 	}
 
-	fb->tempname = basprintf(".fastboot.%d.img", instance++);
+	fb->tempname = make_temp("fastboot");
+	if (!fb->tempname)
+		return -ENOMEM;
 
 	if (IS_ENABLED(CONFIG_BAREBOX_UPDATE) && export_bbu)
 		bbu_handlers_iterate(fastboot_add_bbu_variables, fb);
-- 
2.27.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-17  5:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-17  5:11 [PATCH 1/2] fastboot: Use make_temp() to create temporary file Sascha Hauer
2020-06-17  5:11 ` [PATCH 2/2] fastboot: Drop support for downloading to buffer Sascha Hauer
  -- strict thread matches above, loose matches on Subject: below --
2020-06-15  6:08 [PATCH 1/2] fastboot: Use make_temp() to create temporary file Sascha Hauer
2020-06-15  6:08 ` [PATCH 2/2] fastboot: Drop support for downloading to buffer Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox