summaryrefslogtreecommitdiffstats
path: root/main.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2010-03-20 12:29:37 -0700
committerJosh Stone <jistone@redhat.com>2010-03-20 12:29:37 -0700
commit1d844b57ab0a846b6059e682a6a70403aaef6ebc (patch)
tree4570092c1d83cda42c2160934073f007e0ebd792 /main.cxx
parent1ae727577edea9441033fd0eff179b06e0a87348 (diff)
downloadsystemtap-steved-1d844b57ab0a846b6059e682a6a70403aaef6ebc.tar.gz
systemtap-steved-1d844b57ab0a846b6059e682a6a70403aaef6ebc.tar.xz
systemtap-steved-1d844b57ab0a846b6059e682a6a70403aaef6ebc.zip
PR11405: Warn and continue for parsing errors in tapsets
When we start seeing tapsets provided by third parties, any errors in their files should not be fatal to us. Since we don't really know which tapsets are our own, this leniency applies to all. * main.cxx (main): Warn on tapset errors, but continue unless -W. * testsuite/parseko/bad_tapset/foo.stp: New bogus tapset. * testsuite/parseko/bad_tapset.stp: Check that "-W -I bad_tapset" fails. * testsuite/parseok/bad_tapset.stp: Check that "-I bad_tapset" succeeds. * testsuite/parseok/all_tapsets.stp: Check -W with the default tapsets.
Diffstat (limited to 'main.cxx')
-rw-r--r--main.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.cxx b/main.cxx
index dd2694ae..5f746efd 100644
--- a/main.cxx
+++ b/main.cxx
@@ -1261,7 +1261,8 @@ main (int argc, char * const argv [])
// XXX: privilege only for /usr/share/systemtap?
stapfile* f = parser::parse (s, globbuf.gl_pathv[j], true);
if (f == 0)
- rc ++;
+ s.print_warning("tapset '" + string(globbuf.gl_pathv[j])
+ + "' has errors, and will be skipped.");
else
s.library_files.push_back (f);
@@ -1281,6 +1282,8 @@ main (int argc, char * const argv [])
globfree (& globbuf);
}
}
+ if (s.num_errors())
+ rc ++;
if (rc == 0 && s.last_pass == 1)
{