doc/news.texi | 2 ++ run.go | 6 +++++- diff --git a/doc/news.texi b/doc/news.texi index c94177f5faf4520ff7e5ba81ba4de7c799ce35472139167179950ae75c67e5e0..faf7c77072a06d626a142879516664096b7c4af6e134afa3fb4d2287412a776c 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -6,6 +6,8 @@ @section Release 1.16.0 @itemize @item Unexistent targets are considered always out-of-date, as it should be. +@item + Do not panic if @env{$REDO_LOGS=1} and we were unable to start the command. @end itemize @anchor{Release 1_15_0} diff --git a/run.go b/run.go index 7c2f3263d54ee231ba6bbfaaf4d3a12e163a01f4e17f08db07f2e60f6454d2a8..e041d74826eec0f254d8c97b2b7bd73f6f67e4a332e0e1ebf1e2223af2507b58 100644 --- a/run.go +++ b/run.go @@ -457,9 +457,13 @@ os.FileMode(0666), ); err == nil { fields := []recfile.Field{ {Name: "Build", Value: BuildUUID}, - {Name: "PID", Value: strconv.Itoa(cmd.Process.Pid)}, {Name: "PPID", Value: strconv.Itoa(os.Getpid())}, {Name: "Cwd", Value: cwd}, + } + if cmd.Process != nil { + fields = append(fields, recfile.Field{ + Name: "PID", Value: strconv.Itoa(cmd.Process.Pid), + }) } ts := new(tai64n.TAI64N) ts.FromTime(started)