summaryrefslogtreecommitdiffstats
path: root/main.cxx
diff options
context:
space:
mode:
authorfche <fche>2006-12-06 17:13:47 +0000
committerfche <fche>2006-12-06 17:13:47 +0000
commit129be0acc85b2bb7bb9b3c71b0c4caa350aecb4b (patch)
tree4709106e68a56d8ab1148d73e57f09aa79890ad7 /main.cxx
parentb42d7f79d123ac73da8b43051cbfb3480059b2c3 (diff)
downloadsystemtap-steved-129be0acc85b2bb7bb9b3c71b0c4caa350aecb4b.tar.gz
systemtap-steved-129be0acc85b2bb7bb9b3c71b0c4caa350aecb4b.tar.xz
systemtap-steved-129be0acc85b2bb7bb9b3c71b0c4caa350aecb4b.zip
2006-12-05 Frank Ch. Eigler <fche@redhat.com>
PR 3648 * main.cxx (main): Tweak error message for tapset script execution. Also catch those clever rogues who use stdin.
Diffstat (limited to 'main.cxx')
-rw-r--r--main.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/main.cxx b/main.cxx
index 00d64c71..d91f3df9 100644
--- a/main.cxx
+++ b/main.cxx
@@ -454,7 +454,10 @@ main (int argc, char * const argv [])
int user_file_stat_rc = -1;
if (script_file == "-")
- s.user_file = parser::parse (s, cin, s.guru_mode);
+ {
+ s.user_file = parser::parse (s, cin, s.guru_mode);
+ user_file_stat_rc = fstat (STDIN_FILENO, & user_file_stat);
+ }
else if (script_file != "")
{
s.user_file = parser::parse (s, script_file, s.guru_mode);
@@ -529,8 +532,8 @@ main (int argc, char * const argv [])
user_file_stat.st_dev == tapset_file_stat.st_dev &&
user_file_stat.st_ino == tapset_file_stat.st_ino)
{
- clog << "parse error: tapset file '" << globbuf.gl_pathv[j]
- << "' is already processed as the user script." << endl;
+ clog << "usage error: tapset file '" << globbuf.gl_pathv[j]
+ << "' cannot be run directly as a session script." << endl;
rc ++;
}