diff options
author | Val Packett <val@packett.cool> | 2023-05-04 19:00:43 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-05 00:00:43 +0200 |
commit | d124a1e4699ccba51ec6c68594e1694016314801 (patch) | |
tree | 30fc97812d509652c5fd929d1f2131a6a9840190 /zellij-server/src/lib.rs | |
parent | 6c802cec0df54e5f82056c40e654ed9fd980c5c3 (diff) |
Do not unwrap() the sticky bit setting! (#2424)
It fails on FreeBSD, making the zellij server quit and the client spin endlessly retrying to connect.
Diffstat (limited to 'zellij-server/src/lib.rs')
-rw-r--r-- | zellij-server/src/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/zellij-server/src/lib.rs b/zellij-server/src/lib.rs index f82c9d682..166a60c5f 100644 --- a/zellij-server/src/lib.rs +++ b/zellij-server/src/lib.rs @@ -278,7 +278,8 @@ pub fn start_server(mut os_input: Box<dyn ServerOsApi>, socket_path: PathBuf) { // set the sticky bit to avoid the socket file being potentially cleaned up // https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html states that for XDG_RUNTIME_DIR: // "To ensure that your files are not removed, they should have their access time timestamp modified at least once every 6 hours of monotonic time or the 'sticky' bit should be set on the file. " - set_permissions(&socket_path, 0o1700).unwrap(); + // It is not guaranteed that all platforms allow setting the sticky bit on sockets! + drop(set_permissions(&socket_path, 0o1700)); for stream in listener.incoming() { match stream { Ok(stream) => { |