1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-24 13:48:56 +08:00

Merge pull request #1659 from aidangill-projects/issue-1658

Issue 1658: Fix for parsing error where 'day,' is ignored on AIX uptime check
This commit is contained in:
shirou 2024-06-05 23:39:01 +09:00 committed by GitHub
commit ac15d68545
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -65,7 +65,7 @@ func UptimeWithContext(ctx context.Context) (uint64, error) {
var days uint64 = 0
var hours uint64 = 0
var minutes uint64 = 0
if ut[3] == "days," {
if ut[3] == "day," || ut[3] == "days," {
days, err = strconv.ParseUint(ut[2], 10, 64)
if err != nil {
return 0, err