From c732a41acb817d330610e0e3ebbdcafca6fc2095 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 26 Nov 2016 16:37:46 +0100 Subject: csource: don't emit syz_ syscalls is they are not used --- csource/csource.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'csource/csource.go') diff --git a/csource/csource.go b/csource/csource.go index 4464deb5c..0c4d93ed3 100644 --- a/csource/csource.go +++ b/csource/csource.go @@ -38,11 +38,6 @@ func Write(p *prog.Prog, opts Options) ([]byte, error) { for _, c := range p.Calls { handled[c.Meta.CallName] = c.Meta.NR } - for _, c := range sys.Calls { - if strings.HasPrefix(c.CallName, "syz_") { - handled[c.CallName] = c.NR - } - } for name, nr := range handled { fmt.Fprintf(w, "#ifndef __NR_%v\n", name) fmt.Fprintf(w, "#define __NR_%v %v\n", name, nr) @@ -80,7 +75,8 @@ func Write(p *prog.Prog, opts Options) ([]byte, error) { fmt.Fprint(w, "\treturn 0;\n}\n") } else { fmt.Fprint(w, "int main()\n{\n") - fmt.Fprintf(w, "\tfor (int i = 0; i < %v; i++) {\n", opts.Procs) + fmt.Fprint(w, "\tint i;") + fmt.Fprintf(w, "\tfor (i = 0; i < %v; i++) {\n", opts.Procs) fmt.Fprint(w, "\t\tif (fork() == 0) {\n") fmt.Fprint(w, "\t\t\tsetup_main_process();\n") fmt.Fprintf(w, "\t\t\tdo_sandbox_%v();\n", opts.Sandbox) -- cgit mrf-deployment