diff mbox series

log: include absolute path in error message

Message ID 20230728091635.658063-1-michael.adler@siemens.com
State Accepted
Delegated to: Stefano Babic
Headers show
Series log: include absolute path in error message | expand

Commit Message

Michael Adler July 28, 2023, 9:16 a.m. UTC
If SWUpdate is unable to create a directory, it currently only logs the
relative path of the directory it attempted to create. To improve
troubleshooting, this commit changes the log message to include the
absolute path of the directory.

Signed-off-by: Michael Adler <michael.adler@siemens.com>
Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 core/util.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Stefano Babic Aug. 2, 2023, 3:22 p.m. UTC | #1
On 28.07.23 11:16, 'Michael Adler' via swupdate wrote:
> If SWUpdate is unable to create a directory, it currently only logs the
> relative path of the directory it attempted to create. To improve
> troubleshooting, this commit changes the log message to include the
> absolute path of the directory.
> 
> Signed-off-by: Michael Adler <michael.adler@siemens.com>
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>   core/util.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/core/util.c b/core/util.c
> index 14bac1b..a6ddf82 100644
> --- a/core/util.c
> +++ b/core/util.c
> @@ -156,8 +156,8 @@ void swupdate_create_directory(const char* path) {
>   		return;
>   	}
>   	if (mkdir(dpath, 0777)) {
> -		WARN("Directory %s cannot be created due to : %s",
> -			 path, strerror(errno));
> +		WARN("Directory %s cannot be created: %s",
> +			 dpath, strerror(errno));
>   	}
>   	free(dpath);
>   }

Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/core/util.c b/core/util.c
index 14bac1b..a6ddf82 100644
--- a/core/util.c
+++ b/core/util.c
@@ -156,8 +156,8 @@  void swupdate_create_directory(const char* path) {
 		return;
 	}
 	if (mkdir(dpath, 0777)) {
-		WARN("Directory %s cannot be created due to : %s",
-			 path, strerror(errno));
+		WARN("Directory %s cannot be created: %s",
+			 dpath, strerror(errno));
 	}
 	free(dpath);
 }