Don't create IPC dir on windows

This commit is contained in:
arkpar 2017-10-29 13:35:12 +01:00
parent 44511f9254
commit 4b56f2530d
No known key found for this signature in database
GPG Key ID: CF9ADE6B115EB4DD

View File

@ -304,10 +304,12 @@ pub fn new_ipc<D: rpc_apis::Dependencies>(
let handler = setup_apis(conf.apis, dependencies);
let remote = dependencies.remote.clone();
let path = PathBuf::from(&conf.socket_addr);
if !cfg!(windows) {
if let Some(dir) = path.parent() {
::std::fs::create_dir_all(&dir)
.map_err(|err| format!("Unable to create IPC directory at {}: {}", dir.display(), err))?;
}
}
match rpc::start_ipc(&conf.socket_addr, handler, remote, rpc::RpcExtractor) {
Ok(server) => Ok(Some(server)),