diff mbox series

core: define remove_directory() only if !CONFIG_NOCLEANUP

Message ID 20171002141449.20170-1-christian.storm@siemens.com
State Accepted
Headers show
Series core: define remove_directory() only if !CONFIG_NOCLEANUP | expand

Commit Message

Storm, Christian Oct. 2, 2017, 2:14 p.m. UTC
Fix unused function compiler warning when CONFIG_NOCLEANUP=y

Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 core/swupdate.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Stefano Babic Oct. 3, 2017, 8:42 a.m. UTC | #1
On 02/10/2017 16:14, Christian Storm wrote:
> Fix unused function compiler warning when CONFIG_NOCLEANUP=y
> 
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>  core/swupdate.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/core/swupdate.c b/core/swupdate.c
> index f1140d2..4c5c902 100644
> --- a/core/swupdate.c
> +++ b/core/swupdate.c
> @@ -407,6 +407,7 @@ static void create_directory(const char* path) {
>  	mkdir(dpath, 0777);
>  }
>  
> +#ifndef CONFIG_NOCLEANUP
>  static int _remove_directory_cb(const char *fpath, const struct stat *sb,
>                                  int typeflag, struct FTW *ftwbuf)
>  {
> @@ -422,6 +423,7 @@ static int remove_directory(const char* path)
>  	sprintf(dpath, "%s%s", get_tmpdir(), path);
>  	return nftw(dpath, _remove_directory_cb, 64, FTW_DEPTH | FTW_PHYS);
>  }
> +#endif
>  
>  static void swupdate_cleanup(void)
>  {
> 

Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/core/swupdate.c b/core/swupdate.c
index f1140d2..4c5c902 100644
--- a/core/swupdate.c
+++ b/core/swupdate.c
@@ -407,6 +407,7 @@  static void create_directory(const char* path) {
 	mkdir(dpath, 0777);
 }
 
+#ifndef CONFIG_NOCLEANUP
 static int _remove_directory_cb(const char *fpath, const struct stat *sb,
                                 int typeflag, struct FTW *ftwbuf)
 {
@@ -422,6 +423,7 @@  static int remove_directory(const char* path)
 	sprintf(dpath, "%s%s", get_tmpdir(), path);
 	return nftw(dpath, _remove_directory_cb, 64, FTW_DEPTH | FTW_PHYS);
 }
+#endif
 
 static void swupdate_cleanup(void)
 {