Merge lp:~timg-tpi/ureadahead/LP501715-V2 into lp:ureadahead

Proposed by Tim Gardner on 2010-07-14
Status: Needs review
Proposed branch: lp:~timg-tpi/ureadahead/LP501715-V2
Merge into: lp:ureadahead
Diff against target: 34 lines (+9/-1)
1 file modified
src/trace.c (+9/-1)
To merge this branch: bzr merge lp:~timg-tpi/ureadahead/LP501715-V2
Reviewer Review Type Date Requested Status
Scott James Remnant (Canonical) 2010-07-14 Pending
Review via email: mp+29908@code.launchpad.net

Description of the change

Restore buffer_size_kb _after_ reading the trace log.

To post a comment you must log in.

Unmerged revisions

114. By Tim Gardner on 2010-07-14

Restore buffer_size_kb, LP501715

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/trace.c'
2--- src/trace.c 2009-11-29 15:04:36 +0000
3+++ src/trace.c 2010-07-14 16:58:38 +0000
4@@ -122,6 +122,7 @@
5 int old_open_exec_enabled = 0;
6 int old_uselib_enabled = 0;
7 int old_tracing_enabled = 0;
8+ int old_buffer_size_kb = 0;
9 struct sigaction act;
10 struct sigaction old_sigterm;
11 struct sigaction old_sigint;
12@@ -165,7 +166,7 @@
13
14 old_uselib_enabled = -1;
15 }
16- if (set_value (dfd, "buffer_size_kb", 128000, NULL) < 0)
17+ if (set_value (dfd, "buffer_size_kb", 128000, &old_buffer_size_kb) < 0)
18 goto error;
19 if (set_value (dfd, "tracing_enabled",
20 TRUE, &old_tracing_enabled) < 0)
21@@ -226,6 +227,13 @@
22 if (read_trace (NULL, dfd, "trace", &files, &num_files) < 0)
23 goto error;
24
25+ /*
26+ * Restore the trace buffer size (which has just been read) and free
27+ * a bunch of memory.
28+ */
29+ if (set_value (dfd, "buffer_size_kb", old_buffer_size_kb, NULL) < 0)
30+ goto error;
31+
32 /* Unmount the temporary debugfs mount if we mounted it */
33 if (close (dfd)) {
34 nih_error_raise_system ();

Subscribers

People subscribed via source and target branches