summaryrefslogtreecommitdiffstats
path: root/runtime/staprun/mainloop.c
diff options
context:
space:
mode:
authorddomingo <ddomingo@redhat.com>2008-10-20 16:30:48 +1000
committerddomingo <ddomingo@redhat.com>2008-10-20 16:30:48 +1000
commitaacc3f504dc5e52a8c5a30a469e2c8b9bb9986bd (patch)
tree4c4eafedafff8d56532a22af46c266157f171164 /runtime/staprun/mainloop.c
parent3cb837a1af0ccad4ba335ee6b21e906a3021d198 (diff)
parentb0ff684d5ac5b0ade97a4e508a92a7f743068221 (diff)
downloadsystemtap-steved-aacc3f504dc5e52a8c5a30a469e2c8b9bb9986bd.tar.gz
systemtap-steved-aacc3f504dc5e52a8c5a30a469e2c8b9bb9986bd.tar.xz
systemtap-steved-aacc3f504dc5e52a8c5a30a469e2c8b9bb9986bd.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'runtime/staprun/mainloop.c')
-rw-r--r--runtime/staprun/mainloop.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/runtime/staprun/mainloop.c b/runtime/staprun/mainloop.c
index 6fc061ae..8db42d7d 100644
--- a/runtime/staprun/mainloop.c
+++ b/runtime/staprun/mainloop.c
@@ -126,9 +126,15 @@ void start_cmd(void)
work well if target_cmd is a shell builtin. We really want to
probe a new child process, not a mishmash of shell-interpreted
stuff. */
- rc = wordexp (target_cmd, & words, WRDE_NOCMD);
- if (rc != 0) { _perr ("wordexp parsing error"); _exit (1); }
- if (words.we_wordc < 1) { _perr ("empty target_cmd"); _exit (1); }
+ rc = wordexp (target_cmd, & words, WRDE_NOCMD|WRDE_UNDEF);
+ switch (rc)
+ {
+ case 0: break;
+ case WRDE_BADCHAR: _err ("wordexp: invalid shell meta-character in -c COMMAND\n"); _exit(1);
+ case WRDE_SYNTAX: _err ("wordexp: syntax error (unmatched quotes?) in -c COMMAND\n"); _exit(1);
+ default: _err ("wordexp: parsing error (%d)\n", rc); _exit (1);
+ }
+ if (words.we_wordc < 1) { _err ("empty -c COMMAND"); _exit (1); }
rc = ptrace (PTRACE_TRACEME, 0, 0, 0);
if (rc < 0) perror ("ptrace me");