diff options
author | Shawn Landden <shawn@churchofgit.com> | 2015-03-23 03:48:41 -0700 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-03-24 00:12:03 -0400 |
commit | b53a2485a43a59f3a8e45baabac6fc84a53cb3e6 (patch) | |
tree | 8f2c9110eb9247f18dbb8fd3129c169bbf6121b2 | |
parent | fb02a2775a65198db606d8fc3a03852ce843378f (diff) |
bootchart: remove duplicated code, prevent creating empty files
In Debian and rawhide Fedora, which have CONFIG_SCHEDSTATS=n,
bootchart creates empty files in /run/log before printing an error.
Stop doing that.
Moreover this duplicated part of the code doesn't even have error checking
so there is no error avoided by doing this early.
Reported-by: tfirg_ on IRC
-rw-r--r-- | src/bootchart/bootchart.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c index 99ffb86c87..71dffc9ae8 100644 --- a/src/bootchart/bootchart.c +++ b/src/bootchart/bootchart.c @@ -395,15 +395,6 @@ int main(int argc, char *argv[]) { sampledata->sampletime = gettime_ns(); sampledata->counter = samples; - if (!of && (access(arg_output_path, R_OK|W_OK|X_OK) == 0)) { - t = time(NULL); - r = strftime(datestr, sizeof(datestr), "%Y%m%d-%H%M", localtime(&t)); - assert_se(r > 0); - - snprintf(output_file, PATH_MAX, "%s/bootchart-%s.svg", arg_output_path, datestr); - of = fopen(output_file, "we"); - } - if (sysfd < 0) sysfd = open("/sys", O_RDONLY|O_CLOEXEC); |