summaryrefslogtreecommitdiff
path: root/vendor/go.uber.org/automaxprocs/internal/cgroups/mountpoint.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/go.uber.org/automaxprocs/internal/cgroups/mountpoint.go')
-rw-r--r--vendor/go.uber.org/automaxprocs/internal/cgroups/mountpoint.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/vendor/go.uber.org/automaxprocs/internal/cgroups/mountpoint.go b/vendor/go.uber.org/automaxprocs/internal/cgroups/mountpoint.go
index 2efde4c4b..f3877f78a 100644
--- a/vendor/go.uber.org/automaxprocs/internal/cgroups/mountpoint.go
+++ b/vendor/go.uber.org/automaxprocs/internal/cgroups/mountpoint.go
@@ -95,8 +95,12 @@ func NewMountPointFromLine(line string) (*MountPoint, error) {
for i, field := range fields[_miFieldIDOptionalFields:] {
if field == _mountInfoOptionalFieldsSep {
+ // End of optional fields.
fsTypeStart := _miFieldIDOptionalFields + i + 1
+ // Now we know where the optional fields end, split the line again with a
+ // limit to avoid issues with spaces in super options as present on WSL.
+ fields = strings.SplitN(line, _mountInfoSep, fsTypeStart+_miFieldCountSecondHalf)
if len(fields) != fsTypeStart+_miFieldCountSecondHalf {
return nil, mountPointFormatInvalidError{line}
}