--- nono/lib/autofd.h 2026/04/29 17:04:57 1.1.1.2 +++ nono/lib/autofd.h 2026/04/29 17:05:00 1.1.1.3 @@ -20,8 +20,7 @@ class autofd } ~autofd() { - if (Valid()) - close(fd); + Close(); } autofd& operator=(int fd_) { @@ -35,7 +34,7 @@ class autofd // 明示的にクローズする int Close() { int rv = 0; - if (fd >= 0) { + if (Valid()) { rv = close(fd); fd = -1; }