@@ -33,14 +33,14 @@ void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void),
33
33
char extra_opts_str [1024 ] = "" ;
34
34
35
35
if (!dev ) {
36
- tst_brkm ( TBROK , cleanup_fn ,
37
- "%s:%d: No device specified", file , lineno );
36
+ tst_brkm_ ( file , lineno , TBROK , cleanup_fn ,
37
+ " No device specified" );
38
38
return ;
39
39
}
40
40
41
41
if (!fs_type ) {
42
- tst_brkm ( TBROK , cleanup_fn ,
43
- "%s:%d: No fs_type specified", file , lineno );
42
+ tst_brkm_ ( file , lineno , TBROK , cleanup_fn ,
43
+ " No fs_type specified" );
44
44
return ;
45
45
}
46
46
@@ -51,9 +51,8 @@ void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void),
51
51
argv [pos ++ ] = fs_opts [i ];
52
52
53
53
if (pos + 2 > OPTS_MAX ) {
54
- tst_brkm (TBROK , cleanup_fn ,
55
- "%s:%d: Too much mkfs options" ,
56
- file , lineno );
54
+ tst_brkm_ (file , lineno , TBROK , cleanup_fn ,
55
+ "Too many mkfs options" );
57
56
return ;
58
57
}
59
58
@@ -70,8 +69,8 @@ void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void),
70
69
argv [pos ++ ] = extra_opts [i ];
71
70
72
71
if (pos + 1 > OPTS_MAX ) {
73
- tst_brkm ( TBROK , cleanup_fn ,
74
- "%s:%d: Too much mkfs options", file , lineno );
72
+ tst_brkm_ ( file , lineno , TBROK , cleanup_fn ,
73
+ " Too many mkfs options" );
75
74
return ;
76
75
}
77
76
@@ -83,24 +82,27 @@ void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void),
83
82
84
83
argv [pos ] = NULL ;
85
84
86
- if (tst_clear_device (dev ))
87
- tst_brkm (TBROK , cleanup_fn , "tst_clear_device() failed" );
85
+ if (tst_clear_device (dev )) {
86
+ tst_brkm_ (file , lineno , TBROK , cleanup_fn ,
87
+ "tst_clear_device() failed" );
88
+ }
88
89
89
- tst_resm (TINFO , "Formatting %s with %s opts='%s' extra opts='%s'" ,
90
- dev , fs_type , fs_opts_str , extra_opts_str );
90
+ tst_resm_ (file , lineno , TINFO ,
91
+ "Formatting %s with %s opts='%s' extra opts='%s'" ,
92
+ dev , fs_type , fs_opts_str , extra_opts_str );
91
93
ret = tst_cmd (cleanup_fn , argv , "/dev/null" , NULL , TST_CMD_PASS_RETVAL |
92
94
TST_CMD_TCONF_ON_MISSING );
93
95
94
96
switch (ret ) {
95
97
case 0 :
96
98
break ;
97
99
case 255 :
98
- tst_brkm ( TCONF , cleanup_fn ,
99
- "%s:%d: %s not found in $PATH" , file , lineno , mkfs );
100
+ tst_brkm_ ( file , lineno , TCONF , cleanup_fn ,
101
+ "%s not found in $PATH" , mkfs );
100
102
break ;
101
103
default :
102
- tst_brkm ( TBROK , cleanup_fn ,
103
- "%s:%d: %s failed with %i" , file , lineno , mkfs , ret );
104
+ tst_brkm_ ( file , lineno , TBROK , cleanup_fn ,
105
+ "%s failed with exit code %i" , mkfs , ret );
104
106
}
105
107
}
106
108
0 commit comments