MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / prepare_compute_driver_socket

Function prepare_compute_driver_socket

crates/openshell-driver-vm/src/main.rs:295–305  ·  view source on GitHub ↗
(socket_path: &Path)

Source from the content-addressed store, hash-verified

293}
294
295fn prepare_compute_driver_socket(socket_path: &Path) -> std::result::Result<(), String> {
296 let Some(parent) = socket_path.parent() else {
297 return Err(format!(
298 "vm compute driver socket path '{}' has no parent directory",
299 socket_path.display()
300 ));
301 };
302 let expected_uid = current_euid();
303 prepare_private_socket_dir(parent, expected_uid)?;
304 remove_stale_socket(socket_path, expected_uid)
305}
306
307fn current_euid() -> u32 {
308 rustix::process::geteuid().as_raw()

Callers 1

mainFunction · 0.85

Calls 3

current_euidFunction · 0.70
remove_stale_socketFunction · 0.70

Tested by

no test coverage detected