made all fdstreams RAII for fd

This commit is contained in:
Bob Polis
2020-04-25 17:42:26 +02:00
parent de371a94a5
commit 5012f2e582
3 changed files with 34 additions and 3 deletions

View File

@ -66,7 +66,6 @@ void test3() {
throw_if_min1(fd = ::open("passwd", mode, perm));
sc::io::fdostream os {fd};
os << passwd;
throw_if_min1(::close(fd));
}
void test4() {
@ -77,7 +76,6 @@ void test4() {
while (getline(is, line)) {
cout << line << '\n';
}
throw_if_min1(::close(fd));
}
void test5() {
@ -92,7 +90,6 @@ void test5() {
if (getline(file, line)) {
cout << line << '\n';
}
throw_if_min1(::close(fd));
}
int main(int argc, const char * argv[]) {