summaryrefslogtreecommitdiffstats
path: root/tapset-procfs.cxx
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2010-02-02 08:28:16 -0500
committerDave Brolley <brolley@redhat.com>2010-02-02 08:28:16 -0500
commit743757687f9c09bf9ef84b576bc0aa0fc19dea4c (patch)
treebe77bd3f7d03be09774a25f7260182941e99907a /tapset-procfs.cxx
parent241443ad36a5a2cacb9e8e6f12f808d304835f2a (diff)
parentcc57beca8d9d168ef42edb1f8b43f594105dfdf2 (diff)
downloadsystemtap-steved-743757687f9c09bf9ef84b576bc0aa0fc19dea4c.tar.gz
systemtap-steved-743757687f9c09bf9ef84b576bc0aa0fc19dea4c.tar.xz
systemtap-steved-743757687f9c09bf9ef84b576bc0aa0fc19dea4c.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'tapset-procfs.cxx')
-rw-r--r--tapset-procfs.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/tapset-procfs.cxx b/tapset-procfs.cxx
index aa75af42..f5ab95f8 100644
--- a/tapset-procfs.cxx
+++ b/tapset-procfs.cxx
@@ -383,9 +383,10 @@ procfs_var_expanding_visitor::visit_target_symbol (target_symbol* e)
string locvalue = "CONTEXT->data";
if (! lvalue)
- ec->code = string("_stp_copy_from_user(THIS->__retvalue, ((struct _stp_procfs_data *)(")
- + locvalue + string("))->buffer, ((struct _stp_procfs_data *)(") + locvalue
- + string("))->count); /* pure */");
+ ec->code = string(" struct _stp_procfs_data *data = (struct _stp_procfs_data *)(") + locvalue + string("); /* pure */\n")
+
+ + string(" _stp_copy_from_user(THIS->__retvalue, data->buffer, data->count);\n")
+ + string(" THIS->__retvalue[data->count] = '\\0';\n");
else
ec->code = string("int bytes = 0;\n")
+ string(" struct _stp_procfs_data *data = (struct _stp_procfs_data *)(") + locvalue + string(");\n")