chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test-strv.c: test strv_join added
[elogind.git]
/
src
/
bootchart
/
bootchart.c
diff --git
a/src/bootchart/bootchart.c
b/src/bootchart/bootchart.c
index 3d77bab129f5565c7bdb0f38fdcd027a78b81b0f..f1b0e58c69ba53aebefe5ab878f116adc66c3ab0 100644
(file)
--- a/
src/bootchart/bootchart.c
+++ b/
src/bootchart/bootchart.c
@@
-28,6
+28,7
@@
#include "bootchart.h"
#include "bootchart.h"
+#include "util.h"
double graph_start;
double log_start;
double graph_start;
double log_start;
@@
-74,13
+75,11
@@
int main(int argc, char *argv[])
struct ps_struct *ps;
char output_file[PATH_MAX];
char datestr[200];
struct ps_struct *ps;
char output_file[PATH_MAX];
char datestr[200];
- time_t t;
+ time_t t
= 0
;
FILE *f;
int gind;
int i;
FILE *f;
int gind;
int i;
- memset(&t, 0, sizeof(time_t));
-
rlim.rlim_cur = 4096;
rlim.rlim_max = 4096;
(void) setrlimit(RLIMIT_NOFILE, &rlim);
rlim.rlim_cur = 4096;
rlim.rlim_max = 4096;
(void) setrlimit(RLIMIT_NOFILE, &rlim);
@@
-109,25
+108,25
@@
int main(int argc, char *argv[])
// todo: filter leading/trailing whitespace
// todo: filter leading/trailing whitespace
- if (
!strcmp
(key, "samples"))
+ if (
streq
(key, "samples"))
len = atoi(val);
len = atoi(val);
- if (
!strcmp
(key, "freq"))
+ if (
streq
(key, "freq"))
hz = atof(val);
hz = atof(val);
- if (
!strcmp
(key, "rel"))
+ if (
streq
(key, "rel"))
relative = atoi(val);
relative = atoi(val);
- if (
!strcmp
(key, "filter"))
+ if (
streq
(key, "filter"))
filter = atoi(val);
filter = atoi(val);
- if (
!strcmp
(key, "pss"))
+ if (
streq
(key, "pss"))
pss = atoi(val);
pss = atoi(val);
- if (
!strcmp
(key, "output"))
+ if (
streq
(key, "output"))
strncpy(output_path, val, PATH_MAX - 1);
strncpy(output_path, val, PATH_MAX - 1);
- if (
!strcmp
(key, "init"))
+ if (
streq
(key, "init"))
strncpy(init_path, val, PATH_MAX - 1);
strncpy(init_path, val, PATH_MAX - 1);
- if (
!strcmp
(key, "scale_x"))
+ if (
streq
(key, "scale_x"))
scale_x = atof(val);
scale_x = atof(val);
- if (
!strcmp
(key, "scale_y"))
+ if (
streq
(key, "scale_y"))
scale_y = atof(val);
scale_y = atof(val);
- if (
!strcmp
(key, "entropy"))
+ if (
streq
(key, "entropy"))
entropy = atoi(val);
}
fclose(f);
entropy = atoi(val);
}
fclose(f);
@@
-231,12
+230,11
@@
int main(int argc, char *argv[])
}
/* start with empty ps LL */
}
/* start with empty ps LL */
- ps_first =
malloc(
sizeof(struct ps_struct));
+ ps_first =
calloc(1,
sizeof(struct ps_struct));
if (!ps_first) {
if (!ps_first) {
- perror("
m
alloc(ps_struct)");
+ perror("
c
alloc(ps_struct)");
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
- memset(ps_first, 0, sizeof(struct ps_struct));
/* handle TERM/INT nicely */
memset(&sig, 0, sizeof(struct sigaction));
/* handle TERM/INT nicely */
memset(&sig, 0, sizeof(struct sigaction));