Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update wayland-server to 0.31 #1115

Merged
merged 1 commit into from
Sep 23, 2023
Merged

Update wayland-server to 0.31 #1115

merged 1 commit into from
Sep 23, 2023

Conversation

elinorbgr
Copy link
Member

@elinorbgr elinorbgr commented Sep 2, 2023

Based on #1108
Blocked on Smithay/gbm.rs#26

This is a pretty boring PR, mostly just fixing the prototypes of the methods that changed.

I tested that anvil still runs and is able to display weston-terminal.

Copy link
Member

@Drakulix Drakulix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still blocked, but code wise looks good to me. :)

@elinorbgr elinorbgr force-pushed the elinorbgr/wayland-031 branch 3 times, most recently from 5df2af0 to 0394e34 Compare September 22, 2023 14:01
Copy link
Member

@Drakulix Drakulix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DRM code looks good!

(I already had a nix update in #1132 but nevermind 😅)

if let Err(e) = socket::bind(fd, &addr) {
let _ = ::nix::unistd::close(fd);
if let Err(e) = socket::bind(fd.as_raw_fd(), &addr) {
let _ = ::nix::unistd::close(fd.as_raw_fd());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So socket now returns an OwnedFd, would this cause a double close? Or more specifically, why do we still close it manually?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could use into_raw_fd, but yeah, there should be no reason to call close manually with OwnedFds.

if let Err(e) = socket::listen(fd, 1) {
let _ = ::nix::unistd::close(fd);
if let Err(e) = socket::listen(&fd, 1) {
let _ = ::nix::unistd::close(fd.as_raw_fd());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

return Err(e);
}
Ok(unsafe { FromRawFd::from_raw_fd(fd) })
Ok(unsafe { FromRawFd::from_raw_fd(fd.as_raw_fd()) })
Copy link
Member

@Drakulix Drakulix Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Ok(unsafe { FromRawFd::from_raw_fd(fd.as_raw_fd()) })
Ok(fd.into())

Also implements From<OwnedFd>. The current approach would drop fd afterwards and close the file descriptor we just created the unix socket from.

@Drakulix Drakulix merged commit 2aec201 into master Sep 23, 2023
32 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants