[PR #31] [MERGED] fix unix sockets detection #1395

Closed
opened 2026-05-23 02:58:14 +01:00 by JakeStanger · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JakeStanger/mpd-discord-rpc/pull/31
Author: @jonathannerat
Created: 9/21/2022
Status: Merged
Merged: 9/21/2022
Merged by: @JakeStanger

Base: masterHead: fix/unix-socket-host


📝 Commits (3)

📊 Changes

1 file changed (+7 additions, -1 deletions)

View changed files

📝 src/mpd_conn.rs (+7 -1)

📄 Description

is_file method from PathBuf checks if the path exists and point's to a regular file, which UNIX sockets are not. This PR checks if the file is a socket using Metadata.

Maybe the error can be handled a bit better but I barely know any rust, and this change makes it work in my machine so yeah


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/JakeStanger/mpd-discord-rpc/pull/31 **Author:** [@jonathannerat](https://github.com/jonathannerat) **Created:** 9/21/2022 **Status:** ✅ Merged **Merged:** 9/21/2022 **Merged by:** [@JakeStanger](https://github.com/JakeStanger) **Base:** `master` ← **Head:** `fix/unix-socket-host` --- ### 📝 Commits (3) - [`4f77b3a`](https://github.com/JakeStanger/mpd-discord-rpc/commit/4f77b3a9413c6501991efa80e07cffee9d2e3a3c) correctly detect unix sockets - [`6aca1a2`](https://github.com/JakeStanger/mpd-discord-rpc/commit/6aca1a2b057d1f3da0971b47e7f3dd20ef7a73fa) Update src/mpd_conn.rs - [`c1621db`](https://github.com/JakeStanger/mpd-discord-rpc/commit/c1621db3959417c040107fe1bf2a8e7a521e6a13) style: run cargo fmt ### 📊 Changes **1 file changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/mpd_conn.rs` (+7 -1) </details> ### 📄 Description `is_file` method from `PathBuf` checks if the path exists and point's to a regular file, which UNIX sockets are not. This PR checks if the file is a socket using `Metadata`. Maybe the error can be handled a bit better but I barely know any rust, and this change makes it work in my machine so yeah --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
JakeStanger 2026-05-23 02:58:14 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/mpd-discord-rpc#1395
No description provided.