From 498398f0b59824726a9bc0bbc4c53af5c8b7b4a2 Mon Sep 17 00:00:00 2001
From: chenjiayi <chenjiayi22@huawei.com>
Date: Thu, 2 Nov 2023 18:14:40 +0800
Subject: [PATCH 021/103] fix(devmaster): append zero to the file name

The file name is transferred to 'faccessat', which should be a C
like string that ends with zero.
---
 exts/devmaster/src/lib/builtin/net_id.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/exts/devmaster/src/lib/builtin/net_id.rs b/exts/devmaster/src/lib/builtin/net_id.rs
index 2b2cc59b..e5f1faa6 100644
--- a/exts/devmaster/src/lib/builtin/net_id.rs
+++ b/exts/devmaster/src/lib/builtin/net_id.rs
@@ -401,7 +401,7 @@ fn parse_hotplug_slot_from_function_id(
         });
     }
 
-    let filename = format!("{:08}", function_id);
+    let filename = format!("{:08}\0", function_id);
 
     if unsafe { faccessat(slots_dirfd, filename.as_ptr() as *const c_char, F_OK, 0) } < 0 {
         log_dev!(
-- 
2.33.0

