From 65ed2ab36def2601c25a96486f0d6061f26ee4e5 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Fri, 1 Apr 2022 19:06:58 +0200 Subject: [PATCH] lockcd: Ensure that the base path is created It's /sys/fs/bpf/lockc by default, which of course doesn't exists on fresh systems. Signed-off-by: Michal Rostecki --- lockc/src/bin/lockcd.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lockc/src/bin/lockcd.rs b/lockc/src/bin/lockcd.rs index d5d9037..bcb3066 100644 --- a/lockc/src/bin/lockcd.rs +++ b/lockc/src/bin/lockcd.rs @@ -1,4 +1,4 @@ -use std::{env, path, thread}; +use std::{env, fs, path, thread}; use anyhow::Result; use clap::Parser; @@ -58,6 +58,7 @@ async fn ebpf( .join("fs") .join("bpf") .join("lockc"); + fs::create_dir_all(&path_base)?; let mut bpf = load_bpf(&path_base)?;