提交 07502a44 编写于 作者: C cheng_jinsong 提交者: chengjinsong

codex

Signed-off-by: Ncheng_jinsong <chengjinsong2@huawei.com>
上级 f04001b3
......@@ -144,7 +144,8 @@ def main():
for source in args.source:
print("source {}".format(out_dir))
assert os.path.exists(source)
if not os.path.exists(source):
raise FileNotFoundError
src_dict = get_param_from_cfg(source)
dst = "".join([out_dir, "param_cfg.h"])
......
......@@ -474,7 +474,7 @@ static void CheckServiceSocket(Service *service)
return;
}
static void CheckOndemandService(service)
static void CheckOndemandService(Service *service)
{
CheckServiceSocket(service);
if (strcmp(service->name, "console") == 0) {
......
......@@ -747,7 +747,8 @@ class SeccompPolicyParser:
with open(args.dstfile, 'w') as output_file:
output_file.write(content)
def filter_syscalls_nr(self, name_to_nr):
@staticmethod
def filter_syscalls_nr(name_to_nr):
syscalls = {}
for syscall_name, nr in name_to_nr.items():
if not syscall_name.startswith("__NR_") and not syscall_name.startswith("__ARM_NR_"):
......@@ -776,7 +777,7 @@ class SeccompPolicyParser:
continue
try:
name = k.group(1)
nr = eval(mark_pattern.sub(lambda x: str(name_to_nr[x.group(0)]),
nr = eval(mark_pattern.sub(lambda x: str(name_to_nr.get(x.group(0))),
k.group(2)))
name_to_nr[name] = nr
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册