chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bootchart: oom-check correct variable
[elogind.git]
/
src
/
bootchart
/
store.c
diff --git
a/src/bootchart/store.c
b/src/bootchart/store.c
index 2d2ea428fa570804e1c467727c2a6abd4657fe9c..ed683e88d97472fb11c42ea5c55c2dd1cf1ca656 100644
(file)
--- a/
src/bootchart/store.c
+++ b/
src/bootchart/store.c
@@
-251,6
+251,7
@@
schedstat_next:
_cleanup_fclose_ FILE *st = NULL;
char t[32];
struct ps_struct *parent;
_cleanup_fclose_ FILE *st = NULL;
char t[32];
struct ps_struct *parent;
+ int r;
ps->next_ps = new0(struct ps_struct, 1);
if (!ps->next_ps) {
ps->next_ps = new0(struct ps_struct, 1);
if (!ps->next_ps) {
@@
-310,7
+311,11
@@
schedstat_next:
if (!sscanf(m, "%*s %*s %s", t))
continue;
if (!sscanf(m, "%*s %*s %s", t))
continue;
- ps->starttime = strtod(t, NULL) / 1000.0;
+ r = safe_atod(t, &ps->starttime);
+ if (r < 0)
+ continue;
+
+ ps->starttime /= 1000.0;
if (arg_show_cgroup)
/* if this fails, that's OK */
if (arg_show_cgroup)
/* if this fails, that's OK */
@@
-394,7
+399,7
@@
schedstat_next:
continue;
ps->sample->next = new0(struct ps_sched_struct, 1);
continue;
ps->sample->next = new0(struct ps_sched_struct, 1);
- if (!ps->sample) {
+ if (!ps->sample
->next
) {
log_oom();
exit(EXIT_FAILURE);
}
log_oom();
exit(EXIT_FAILURE);
}