summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/proc/task.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-07-16 18:12:07 -0700
committergVisor bot <gvisor-bot@google.com>2019-07-16 18:12:07 -0700
commit78a2704bde50515accacabe8b5734923d0085ef9 (patch)
tree48c4e5ae7c088d1c9d1f0e8cb889582afc1cc420 /pkg/sentry/fs/proc/task.go
parent89368456d86e2329c46594490c58cfc51c9c7c92 (diff)
parentc61d7761b42392d6c28ab6932707e0d3236e0b74 (diff)
Merge pull request #474 from zhuangel:proctasks
PiperOrigin-RevId: 258479216
Diffstat (limited to 'pkg/sentry/fs/proc/task.go')
-rw-r--r--pkg/sentry/fs/proc/task.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/sentry/fs/proc/task.go b/pkg/sentry/fs/proc/task.go
index d82d4e998..87184ec67 100644
--- a/pkg/sentry/fs/proc/task.go
+++ b/pkg/sentry/fs/proc/task.go
@@ -188,6 +188,7 @@ func (f *subtasksFile) Readdir(ctx context.Context, file *fs.File, ser fs.Dentry
taskInts = append(taskInts, int(tid))
}
+ sort.Sort(sort.IntSlice(taskInts))
// Find the task to start at.
idx := sort.SearchInts(taskInts, int(offset))
if idx == len(taskInts) {