jsonrpc: don't umask in unit tests

It can interfere with the creation of dummy directories in other threads and cause spurious errors
This commit is contained in:
Antoine Poinsot committed 2022-08-17 19:39:59 +02:00
1 parent 14bd3890dc
commit e6fcdd5b09
1 file changed
+2
+2
View File
@@ -194,8 +194,10 @@ fn bind(socket_path: &path::Path) -> Result<net::UnixListener, io::Error> {
pub fn rpcserver_setup(socket_path: &path::Path) -> Result<net::UnixListener, io::Error> {
log::debug!("Binding socket at {}", socket_path.display());
// Create the socket with RW permissions only for the user
#[cfg(not(test))]
let old_umask = unsafe { libc::umask(0o177) };
let listener = bind(&socket_path);
#[cfg(not(test))]
unsafe {
libc::umask(old_umask);
}