@@ -118,7 +118,7 @@ int main(int argc, char *argv[])
118
118
struct log_book * lb ;
119
119
struct node_id node_id ;
120
120
struct lightningd * ld ;
121
- char tmpfiletemplate [] = "/tmp/run-log_filter.XXXXXX" ;
121
+ char * tmpfile ;
122
122
123
123
common_setup (argv [0 ]);
124
124
@@ -131,8 +131,8 @@ int main(int argc, char *argv[])
131
131
ld -> log = new_logger (ld , lb , NULL , "dummy" );
132
132
assert (arg_log_to_file ("-" , ld ) == NULL );
133
133
134
- assert (mkstemp ( tmpfiletemplate ) >= 0 );
135
- assert (arg_log_to_file (tmpfiletemplate , ld ) == NULL );
134
+ assert (tmpdir_mkstemp ( tmpctx , "run-log_filter.XXXXXX" , & tmpfile ) >= 0 );
135
+ assert (arg_log_to_file (tmpfile , ld ) == NULL );
136
136
137
137
/* Log level default. */
138
138
assert (opt_log_level ("BROKEN" , lb ) == NULL );
@@ -224,7 +224,7 @@ int main(int argc, char *argv[])
224
224
assert (try_log (lb , "prefix" , NULL , LOG_IO_IN ) == 0 );
225
225
226
226
/* File exception: tmpfile logs everything */
227
- assert (opt_log_level (tal_fmt (tmpctx , "io::%s" , tmpfiletemplate ), lb ) == NULL );
227
+ assert (opt_log_level (tal_fmt (tmpctx , "io::%s" , tmpfile ), lb ) == NULL );
228
228
assert (try_log (lb , "stdout1" , NULL , LOG_BROKEN ) == 2 );
229
229
assert (try_log (lb , "stdout1" , NULL , LOG_INFORM ) == 2 );
230
230
assert (try_log (lb , "stdout1" , NULL , LOG_DBG ) == 2 );
0 commit comments