commit | 6496c4bf6f31bd0714a341d51c1cff7f15938e84 | [log] [tgz] |
---|---|---|
author | Josh Gao <jmgao@google.com> | Mon Aug 29 14:20:59 2016 -0700 |
committer | Josh Gao <jmgao@google.com> | Mon Aug 29 14:37:49 2016 -0700 |
tree | 721bcd144350e93de01556be07ae313c3e5574ba | |
parent | e461b37965ff609ea36c1fbb6e4e8df1fb7b7d7f [diff] |
base: disallow close() on unique_fd. unique_fd's implicit conversion to int allows it to be passed to close(2), which is dangerous because unique_fd will think that it still has ownership of the now-closed fd. Disallow this by providing an overload for close that's tagged with an attribute that gives a compile-time error. Test: m Change-Id: I514591335b337f2f57c1df371cf3979304aea17c