Fixed cgroup device Entry.Selector major/minor number type. A cgroup device is identified by a major and a minor number. They are 'unsigned int' type. A pair of <major:minor> represents a 'dev_t'. For details: http://man7.org/linux/man-pages/man3/makedev.3.html
Review: https://reviews.apache.org/r/61015/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c65fb009 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c65fb009 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c65fb009 Branch: refs/heads/master Commit: c65fb009e452e9a6cb0c9e2f8541423b74dd64cc Parents: d532518 Author: Gilbert Song <songzihao1...@gmail.com> Authored: Mon Jul 31 15:45:43 2017 -0700 Committer: Gilbert Song <songzihao1...@gmail.com> Committed: Mon Jul 31 15:45:43 2017 -0700 ---------------------------------------------------------------------- src/linux/cgroups.cpp | 6 ++---- src/linux/cgroups.hpp | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/c65fb009/src/linux/cgroups.cpp ---------------------------------------------------------------------- diff --git a/src/linux/cgroups.cpp b/src/linux/cgroups.cpp index 28c31f6..21f9983 100644 --- a/src/linux/cgroups.cpp +++ b/src/linux/cgroups.cpp @@ -2914,8 +2914,7 @@ Try<Entry> Entry::parse(const string& s) entry.selector.minor = None(); if (deviceNumbers[0] != "*") { - Try<dev_t> major = numify<dev_t>(deviceNumbers[0]); - + Try<unsigned int> major = numify<unsigned int>(deviceNumbers[0]); if (major.isError()) { return Error("Invalid format"); } @@ -2924,8 +2923,7 @@ Try<Entry> Entry::parse(const string& s) } if (deviceNumbers[1] != "*") { - Try<dev_t> minor = numify<dev_t>(deviceNumbers[1]); - + Try<unsigned int> minor = numify<unsigned int>(deviceNumbers[1]); if (minor.isError()) { return Error("Invalid format"); } http://git-wip-us.apache.org/repos/asf/mesos/blob/c65fb009/src/linux/cgroups.hpp ---------------------------------------------------------------------- diff --git a/src/linux/cgroups.hpp b/src/linux/cgroups.hpp index 964543c..e708747 100644 --- a/src/linux/cgroups.hpp +++ b/src/linux/cgroups.hpp @@ -891,8 +891,8 @@ struct Entry }; Type type; - Option<dev_t> major; // Matches all `major` numbers if None. - Option<dev_t> minor; // Matches all `minor` numbers if None. + Option<unsigned int> major; // Matches all `major` numbers if None. + Option<unsigned int> minor; // Matches all `minor` numbers if None. }; struct Access