1
0
Mirror von https://github.com/tkuschel/bees.git synchronisiert 2026-06-19 06:57:54 +02:00

fd: make the close method on IOHandle private

Fd's cache does not handle changes in the state of its IOHandle parameter.
If we allow:

	Fd f;
	f->close();

then Fd ends up caching a pointer to a closed Fd, and will become very
badly confused if a new Fd appears with the same int identifier.

Fix by removing the close method.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
Dieser Commit ist enthalten in:
Zygo Blaxell
2021-04-04 14:17:32 -04:00
Ursprung 06062cfd96
Commit 7cffad5fc3
2 geänderte Dateien mit 13 neuen und 8 gelöschten Zeilen
+1 -1
Datei anzeigen
@@ -35,11 +35,11 @@ namespace crucible {
IOHandle& operator=(IOHandle &&) = delete;
IOHandle& operator=(const IOHandle &) = delete;
int m_fd;
void close();
public:
virtual ~IOHandle();
IOHandle(int fd = -1);
int get_fd() const;
void close();
};
class Fd {