From c5707f5e575f3a4220faede18a51f7a8c7ee1377 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Tue, 4 Oct 2016 16:12:12 +0200 Subject: executor: emit ethernet traffic --- csource/csource.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'csource/csource.go') diff --git a/csource/csource.go b/csource/csource.go index 0c4d93ed3..42eca2038 100644 --- a/csource/csource.go +++ b/csource/csource.go @@ -59,7 +59,7 @@ func Write(p *prog.Prog, opts Options) ([]byte, error) { generateTestFunc(w, opts, calls, "loop") fmt.Fprint(w, "int main()\n{\n") - fmt.Fprint(w, "\tsetup_main_process();\n") + fmt.Fprint(w, "\tsetup_main_process(0);\n") fmt.Fprintf(w, "\tint pid = do_sandbox_%v();\n", opts.Sandbox) fmt.Fprint(w, "\tint status = 0;\n") fmt.Fprint(w, "\twhile (waitpid(pid, &status, __WALL) != pid) {}\n") @@ -68,7 +68,7 @@ func Write(p *prog.Prog, opts Options) ([]byte, error) { generateTestFunc(w, opts, calls, "test") if opts.Procs <= 1 { fmt.Fprint(w, "int main()\n{\n") - fmt.Fprint(w, "\tsetup_main_process();\n") + fmt.Fprint(w, "\tsetup_main_process(0);\n") fmt.Fprintf(w, "\tint pid = do_sandbox_%v();\n", opts.Sandbox) fmt.Fprint(w, "\tint status = 0;\n") fmt.Fprint(w, "\twhile (waitpid(pid, &status, __WALL) != pid) {}\n") @@ -78,7 +78,7 @@ func Write(p *prog.Prog, opts Options) ([]byte, error) { 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.Fprint(w, "\t\t\tsetup_main_process(i);\n") fmt.Fprintf(w, "\t\t\tdo_sandbox_%v();\n", opts.Sandbox) fmt.Fprint(w, "\t\t}\n") fmt.Fprint(w, "\t}\n") -- cgit mrf-deployment