commit | d2b2f3e357841737f9740338a96478c22dbfe63c | [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 | 3c0935eb2b16064831b0855a275feeefe4297681 | |
parent | fdfd816e6671fecf56e9f16b953bfa3d69f794bc [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