diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2020-06-11 10:32:39 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-06-12 10:45:29 +0200 |
commit | 5e2ebdbcbf07d045583a36523770cb2eb42cafee (patch) | |
tree | a947a27ea565cfcc43b97d3d3201c5b1f67dda36 /common/fastboot.c | |
parent | 6c1e7688df94a9d4dfebeb62266f7fc91c209d8a (diff) | |
download | barebox-5e2ebdbcbf07d045583a36523770cb2eb42cafee.tar.gz barebox-5e2ebdbcbf07d045583a36523770cb2eb42cafee.tar.xz |
fastboot: Use make_temp() to create temporary file
make_temp() was created for this purpose, so use it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/fastboot.c')
-rw-r--r-- | common/fastboot.c | 5 |
1 files 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); |