diff options
author | dsmith <dsmith> | 2007-09-14 14:29:21 +0000 |
---|---|---|
committer | dsmith <dsmith> | 2007-09-14 14:29:21 +0000 |
commit | bcf31db437b07b22f1bda965e980b5c98442b163 (patch) | |
tree | cf70b981f0a8ad8d643e0f4a1694616c6052d984 | |
parent | 70cafb08301af7028904201075ef2c7335254b8d (diff) | |
download | systemtap-steved-bcf31db437b07b22f1bda965e980b5c98442b163.tar.gz systemtap-steved-bcf31db437b07b22f1bda965e980b5c98442b163.tar.xz systemtap-steved-bcf31db437b07b22f1bda965e980b5c98442b163.zip |
2007-09-14 David Smith <dsmith@redhat.com>
PR 1154
* tapsets.cxx (procfs_derived_probe_group::emit_module_init):
Fixed problem where if only one type (read/write) of procfs probe
was defined, the generated code wouldn't compile.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | tapsets.cxx | 30 |
2 files changed, 28 insertions, 9 deletions
@@ -1,3 +1,10 @@ +2007-09-14 David Smith <dsmith@redhat.com> + + PR 1154 + * tapsets.cxx (procfs_derived_probe_group::emit_module_init): + Fixed problem where if only one type (read/write) of procfs probe + was defined, the generated code wouldn't compile. + 2007-09-13 David Smith <dsmith@redhat.com> PR 1154 diff --git a/tapsets.cxx b/tapsets.cxx index f57c73f8..38067a7b 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -4694,17 +4694,29 @@ procfs_derived_probe_group::emit_module_init (systemtap_session& s) s.op->newline() << "break;"; s.op->newline(-1) << "}"; - s.op->newline() << "if (spp->read_pp)"; - s.op->newline(1) << "_stp_procfs_files[i]->read_proc = &_stp_procfs_read;"; - s.op->newline(-1) << "else"; - s.op->newline(1) << "_stp_procfs_files[i]->read_proc = NULL;"; + if (has_read_probes) + { + s.op->newline() << "if (spp->read_pp)"; + s.op->newline(1) << "_stp_procfs_files[i]->read_proc = &_stp_procfs_read;"; + s.op->newline(-1) << "else"; + s.op->newline(1) << "_stp_procfs_files[i]->read_proc = NULL;"; + s.op->indent(-1); + } + else + s.op->newline() << "_stp_procfs_files[i]->read_proc = NULL;"; - s.op->newline(-1) << "if (spp->write_pp)"; - s.op->newline(1) << "_stp_procfs_files[i]->write_proc = &_stp_procfs_write;"; - s.op->newline(-1) << "else"; - s.op->newline(1) << "_stp_procfs_files[i]->write_proc = NULL;"; + if (has_write_probes) + { + s.op->newline(-1) << "if (spp->write_pp)"; + s.op->newline(1) << "_stp_procfs_files[i]->write_proc = &_stp_procfs_write;"; + s.op->newline(-1) << "else"; + s.op->newline(1) << "_stp_procfs_files[i]->write_proc = NULL;"; + s.op->indent(-1); + } + else + s.op->newline() << "_stp_procfs_files[i]->write_proc = NULL;"; - s.op->newline(-1) << "_stp_procfs_files[i]->data = spp;"; + s.op->newline() << "_stp_procfs_files[i]->data = spp;"; s.op->newline(-1) << "}"; // for loop } |