aboutsummaryrefslogtreecommitdiffstats
path: root/csource
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2016-11-29 19:02:58 +0100
committerAndrey Konovalov <andreyknvl@google.com>2016-11-29 19:02:58 +0100
commit11e1b430a81b1367979fed22eeaca95f303b8f9f (patch)
tree17df9221a757e106f4f7414ddf92abb97765751f /csource
parent6d413cab8f4b25e9e0982f7771358da68779a126 (diff)
csourse: emit remove_dir only when needed
Diffstat (limited to 'csource')
-rw-r--r--csource/common.go2
-rw-r--r--csource/csource.go4
2 files changed, 4 insertions, 2 deletions
diff --git a/csource/common.go b/csource/common.go
index 186678951..0cedc9920 100644
--- a/csource/common.go
+++ b/csource/common.go
@@ -519,6 +519,7 @@ static int do_sandbox_namespace()
}
#endif
+#if defined(SYZ_EXECUTOR) || defined(SYZ_REPEAT)
static void remove_dir(const char* dir)
{
DIR* dp;
@@ -587,6 +588,7 @@ retry:
exitf("rmdir(%s) failed", dir);
}
}
+#endif
#if defined(SYZ_EXECUTOR) || defined(SYZ_REPEAT)
static uint64_t current_time_ms()
diff --git a/csource/csource.go b/csource/csource.go
index 5871f35c0..d717ce153 100644
--- a/csource/csource.go
+++ b/csource/csource.go
@@ -262,7 +262,7 @@ func preprocessCommonHeader(opts Options, handled map[string]int) (string, error
cmd.Args = append(cmd.Args, "-DSYZ_REPEAT")
}
for name, _ := range handled {
- cmd.Args = append(cmd.Args, "-D__NR_" + name)
+ cmd.Args = append(cmd.Args, "-D__NR_"+name)
}
cmd.Stdin = strings.NewReader(commonHeader)
stderr := new(bytes.Buffer)
@@ -279,7 +279,7 @@ func preprocessCommonHeader(opts Options, handled map[string]int) (string, error
continue
}
define := strings.TrimPrefix(arg, "-D")
- out = strings.Replace(out, "#define " + define + " 1\n", "", -1)
+ out = strings.Replace(out, "#define "+define+" 1\n", "", -1)
}
return out, nil
}