commit | 92ee52cc38ca1a06b7b0851643314b0830f0ece9 | [log] [tgz] |
---|---|---|
author | Josh Gao <jmgao@google.com> | Fri Jan 25 16:22:41 2019 -0800 |
committer | Josh Gao <jmgao@google.com> | Wed Jan 30 15:18:56 2019 -0800 |
tree | 63620c99b06c38346d34a8721b13f3933f491f96 | |
parent | 2dc8b4cec8c2900f77a0dc4ff7219401e3552d7a [diff] |
base: don't overwrite errno in unique_fd::~unique_fd. unique_fd's destructor potentially mangling errno makes it difficult to use correctly in code that sets errno (or, in reality, it makes it so that errno values get randomly stomped upon if close actually sets errno, because no one accounts for this case). Preserve errno ourselves to avoid this. Test: treehugger Change-Id: Ib06e6f65866d86fff4032b2311021eaf9226a1af