diff options
Diffstat (limited to 'tools/perf/util/data.c')
-rw-r--r-- | tools/perf/util/data.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c index 1fbcd8bdc11b..55de44ecebef 100644 --- a/tools/perf/util/data.c +++ b/tools/perf/util/data.c | |||
@@ -86,10 +86,17 @@ static int open_file_read(struct perf_data_file *file) | |||
86 | 86 | ||
87 | static int open_file_write(struct perf_data_file *file) | 87 | static int open_file_write(struct perf_data_file *file) |
88 | { | 88 | { |
89 | int fd; | ||
90 | |||
89 | if (check_backup(file)) | 91 | if (check_backup(file)) |
90 | return -1; | 92 | return -1; |
91 | 93 | ||
92 | return open(file->path, O_CREAT|O_RDWR|O_TRUNC, S_IRUSR|S_IWUSR); | 94 | fd = open(file->path, O_CREAT|O_RDWR|O_TRUNC, S_IRUSR|S_IWUSR); |
95 | |||
96 | if (fd < 0) | ||
97 | pr_err("failed to open %s : %s\n", file->path, strerror(errno)); | ||
98 | |||
99 | return fd; | ||
93 | } | 100 | } |
94 | 101 | ||
95 | static int open_file(struct perf_data_file *file) | 102 | static int open_file(struct perf_data_file *file) |