@@ -130,8 +130,12 @@ init(Parent,LogDir,Nodes) ->
130130 end
131131 end ,
132132
133+ {ok ,Cwd } = file :get_cwd (),
134+ ok = file :set_cwd (LogDir ),
133135 _ = make_all_runs_index (LogDir ),
134136 CtLogFd = open_ct_master_log (RunDirAbs ),
137+ ok = file :set_cwd (Cwd ),
138+
135139 NodeStr =
136140 lists :flatten (lists :map (fun (N ) ->
137141 atom_to_list (N ) ++ " "
@@ -183,15 +187,21 @@ loop(State) ->
183187 lists :foreach (Fun ,List ),
184188 loop (State );
185189 {make_all_runs_index ,From } ->
190+ {ok ,Cwd } = file :get_cwd (),
191+ ok = file :set_cwd (State # state .logdir ),
186192 _ = make_all_runs_index (State # state .logdir ),
193+ ok = file :set_cwd (Cwd ),
187194 return (From ,State # state .logdir ),
188195 loop (State );
189196 {{nodedir ,Node ,RunDir },From } ->
190197 print_nodedir (Node ,RunDir ,State # state .nodedir_ix_fd ),
191198 return (From ,ok ),
192199 loop (State );
193200 stop ->
201+ {ok ,Cwd } = file :get_cwd (),
202+ ok = file :set_cwd (State # state .logdir ),
194203 _ = make_all_runs_index (State # state .logdir ),
204+ ok = file :set_cwd (Cwd ),
195205 io :format (State # state .log_fd ,
196206 int_header ()++ int_footer (),
197207 [log_timestamp (? now )," Finished!" ]),
0 commit comments