diff mbox series

[11/19] Unify error handling in lib/tst_fs_setup.c

Message ID 20201026164756.30556-12-mdoucha@suse.cz
State Changes Requested
Headers show
Series Unify error handling in LTP library | expand

Commit Message

Martin Doucha Oct. 26, 2020, 4:47 p.m. UTC
- Properly format caller file:line location

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 lib/tst_fs_setup.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Yang Xu Oct. 27, 2020, 1:12 p.m. UTC | #1
HI Martin
> - Properly format caller file:line location
>
> Signed-off-by: Martin Doucha<mdoucha@suse.cz>
> ---
>   lib/tst_fs_setup.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/lib/tst_fs_setup.c b/lib/tst_fs_setup.c
> index 54ea37077..a2dacd2ad 100644
> --- a/lib/tst_fs_setup.c
> +++ b/lib/tst_fs_setup.c
> @@ -36,11 +36,11 @@ int mount_overlay(const char *file, const int lineno, int skip)
>
>   	if (errno == ENODEV) {
>   		if (skip) {
> -			tst_brk(TCONF, "%s:%d: " TST_FS_SETUP_OVERLAYFS_MSG,
> -				file, lineno);
> +			tst_brk_(file, lineno, TCONF,
> +				TST_FS_SETUP_OVERLAYFS_MSG);
>   		} else {
> -			tst_res(TINFO, "%s:%d: " TST_FS_SETUP_OVERLAYFS_MSG,
> -				file, lineno);
> +			tst_res_(file, lineno, TINFO,
> +				TST_FS_SETUP_OVERLAYFS_MSG);
>   		}
>   	} else {
>   		tst_brk(TBROK | TERRNO, "overlayfs mount failed");

We should  also use tst_brk_ to replace this.
diff mbox series

Patch

diff --git a/lib/tst_fs_setup.c b/lib/tst_fs_setup.c
index 54ea37077..a2dacd2ad 100644
--- a/lib/tst_fs_setup.c
+++ b/lib/tst_fs_setup.c
@@ -36,11 +36,11 @@  int mount_overlay(const char *file, const int lineno, int skip)
 
 	if (errno == ENODEV) {
 		if (skip) {
-			tst_brk(TCONF, "%s:%d: " TST_FS_SETUP_OVERLAYFS_MSG,
-				file, lineno);
+			tst_brk_(file, lineno, TCONF,
+				TST_FS_SETUP_OVERLAYFS_MSG);
 		} else {
-			tst_res(TINFO, "%s:%d: " TST_FS_SETUP_OVERLAYFS_MSG,
-				file, lineno);
+			tst_res_(file, lineno, TINFO,
+				TST_FS_SETUP_OVERLAYFS_MSG);
 		}
 	} else {
 		tst_brk(TBROK | TERRNO, "overlayfs mount failed");