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.
This commit is contained in:
parent
6c802cec0d
commit
d124a1e469
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
// 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:
|
// 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. "
|
// "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() {
|
for stream in listener.incoming() {
|
||||||
match stream {
|
match stream {
|
||||||
Ok(stream) => {
|
Ok(stream) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue