Skip to content

Commit 09112cd

Browse files
committed
gio: Use OwnedFd to close the socket on error instead of libc::close()
1 parent 452a038 commit 09112cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gio/src/socket.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl Socket {
2929
if error.is_null() {
3030
Ok(from_glib_full(ret))
3131
} else {
32-
libc::close(fd);
32+
let _ = OwnedFd::from_raw_fd(fd);
3333
Err(from_glib_full(error))
3434
}
3535
}

0 commit comments

Comments
 (0)