mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-24 20:09:49 +00:00
csourse: emit remove_dir only when needed
This commit is contained in:
parent
6d413cab8f
commit
11e1b430a8
@ -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()
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -538,6 +538,7 @@ static int do_sandbox_namespace()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(SYZ_EXECUTOR) || defined(SYZ_REPEAT)
|
||||
// One does not simply remove a directory.
|
||||
// There can be mounts, so we need to try to umount.
|
||||
// Moreover, a mount can be mounted several times, so we need to try to umount in a loop.
|
||||
@ -614,6 +615,7 @@ retry:
|
||||
exitf("rmdir(%s) failed", dir);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(SYZ_EXECUTOR) || defined(SYZ_REPEAT)
|
||||
static uint64_t current_time_ms()
|
||||
|
Loading…
Reference in New Issue
Block a user