summaryrefslogtreecommitdiff
path: root/vendor/github.com/prometheus/procfs/proc_status.go
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-05-26 16:13:55 +0200
committerLibravatar tobi <kipvandenbos@noreply.codeberg.org>2025-05-26 16:13:55 +0200
commit143febb318ee16ca68ea312249ab5dadeab608bb (patch)
tree594820ce5f746c7c9d0e28cc8820da563b0c4bdd /vendor/github.com/prometheus/procfs/proc_status.go
parent[chore] migration to update `statuses.thread_id` to be notnull (#4160) (diff)
downloadgotosocial-143febb318ee16ca68ea312249ab5dadeab608bb.tar.xz
[chore] update dependencies (#4196)
- go.opentelemetry.io/contrib/exporters/autoexport v0.60.0 -> v0.61.0 - go.opentelemetry.io/contrib/instrumentation/runtime v0.60.0 -> v0.61.0 Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4196 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/github.com/prometheus/procfs/proc_status.go')
-rw-r--r--vendor/github.com/prometheus/procfs/proc_status.go18
1 files changed, 11 insertions, 7 deletions
diff --git a/vendor/github.com/prometheus/procfs/proc_status.go b/vendor/github.com/prometheus/procfs/proc_status.go
index a055197c6..dd8aa5688 100644
--- a/vendor/github.com/prometheus/procfs/proc_status.go
+++ b/vendor/github.com/prometheus/procfs/proc_status.go
@@ -146,7 +146,11 @@ func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintByt
}
}
case "NSpid":
- s.NSpids = calcNSPidsList(vString)
+ nspids, err := calcNSPidsList(vString)
+ if err != nil {
+ return err
+ }
+ s.NSpids = nspids
case "VmPeak":
s.VmPeak = vUintBytes
case "VmSize":
@@ -222,17 +226,17 @@ func calcCpusAllowedList(cpuString string) []uint64 {
return g
}
-func calcNSPidsList(nspidsString string) []uint64 {
- s := strings.Split(nspidsString, " ")
+func calcNSPidsList(nspidsString string) ([]uint64, error) {
+ s := strings.Split(nspidsString, "\t")
var nspids []uint64
for _, nspid := range s {
- nspid, _ := strconv.ParseUint(nspid, 10, 64)
- if nspid == 0 {
- continue
+ nspid, err := strconv.ParseUint(nspid, 10, 64)
+ if err != nil {
+ return nil, err
}
nspids = append(nspids, nspid)
}
- return nspids
+ return nspids, nil
}