mirror of
https://github.com/taigrr/systemctl.git
synced 2026-04-02 02:28:50 -07:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
701893ebbd
|
@@ -15,11 +15,11 @@ func GetStartTime(ctx context.Context, unit string, opts Options) (time.Time, er
|
||||
value, err := Show(ctx, unit, properties.ExecMainStartTimestamp, opts)
|
||||
|
||||
if err != nil {
|
||||
return time.Unix(0, 0), err
|
||||
return time.Time{}, err
|
||||
}
|
||||
// ExecMainStartTimestamp returns an empty string if the unit is not running
|
||||
if value == "" {
|
||||
return time.Unix(0, 0), ErrUnitNotActive
|
||||
return time.Time{}, ErrUnitNotActive
|
||||
}
|
||||
return time.Parse(dateFormat, value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user