- _syscall(listen(server, 1));
- InjectLibrary(pid);
- client_ = _syscall(accept(server, NULL, NULL));
- } catch (...) {
- _syscall(close(server));
- throw;
- }
+ struct File {
+ const char *path_;
+
+ File(const char *path) :
+ path_(path)
+ {
+ }
+
+ ~File() {
+ unlink(path_);
+ }
+ } file(address.sun_path);
+
+ _syscall(bind(server, reinterpret_cast<sockaddr *>(&address), SUN_LEN(&address)));
+ _syscall(chmod(address.sun_path, 0777));
+
+ _syscall(listen(server, 1));
+ InjectLibrary(pid);
+ client_ = _syscall(accept(server, NULL, NULL));