aboutsummaryrefslogtreecommitdiffstats
path: root/csource/csource.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2015-12-23 13:59:29 +0100
committerDmitry Vyukov <dvyukov@google.com>2015-12-23 13:59:29 +0100
commit1f580dac3d82075b93cc18044501fd01024d5f9a (patch)
treef99f8ae98782ea7d597b7efd9041826d92957294 /csource/csource.go
parent2fa51b4807c7a250b49d086f8343546587c95f8a (diff)
fileutil: new package
Move some file utilities into a separate package.
Diffstat (limited to 'csource/csource.go')
-rw-r--r--csource/csource.go15
1 files changed, 0 insertions, 15 deletions
diff --git a/csource/csource.go b/csource/csource.go
index 03ce4b84c..5caa74af5 100644
--- a/csource/csource.go
+++ b/csource/csource.go
@@ -199,21 +199,6 @@ loop:
return calls, n
}
-// WriteTempFile writes data to a temp file and returns its name.
-func WriteTempFile(data []byte) (string, error) {
- f, err := ioutil.TempFile("", "syz-prog")
- if err != nil {
- return "", fmt.Errorf("failed to create a temp file: %v", err)
- }
- if _, err := f.Write(data); err != nil {
- f.Close()
- os.Remove(f.Name())
- return "", fmt.Errorf("failed to write temp file: %v", err)
- }
- f.Close()
- return f.Name(), nil
-}
-
// Build builds a C/C++ program from source file src
// and returns name of the resulting binary.
func Build(src string) (string, error) {