summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2008-07-30 12:39:51 -0400
committerDave Brolley <brolley@redhat.com>2008-07-30 12:39:51 -0400
commit161be0d9d13449d74de97327786dde83da24bd86 (patch)
tree186a633cf23317fedce9fd646038a49fbf0ba7e4
parente59868d97dbe9b28ea2f3730252c38a582b19a0f (diff)
downloadsystemtap-steved-161be0d9d13449d74de97327786dde83da24bd86.tar.gz
systemtap-steved-161be0d9d13449d74de97327786dde83da24bd86.tar.xz
systemtap-steved-161be0d9d13449d74de97327786dde83da24bd86.zip
No need for random suffix file cmdline and sysinfo files in the
client's request tree.
-rw-r--r--ChangeLog7
-rwxr-xr-xstap-client16
-rwxr-xr-xstap-server24
3 files changed, 24 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index 0f754989..6a8101bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-07-30 Dave Brolley <brolley@redhat.com>
+
+ * stap-client (create_request): No need for random suffix for
+ cmdline and sysinfo files.
+ * stap-server (read_data_file): File name is exactly as specified.
+ Check that it exists.
+
2008-07-29 Dave Brolley <brolley@redhat.com>
* Makefile.am (bin_SCRIPTS): add stap-find-servers, stap-start-server,
diff --git a/stap-client b/stap-client
index 033ef4b3..d6bb8442 100755
--- a/stap-client
+++ b/stap-client
@@ -296,22 +296,16 @@ function create_request {
if test "X$script_file" != "X"; then
if test "$script_file" = "-"; then
mkdir -p $tmpdir_client/script || \
- fatal "ERROR: cannot create temporary diectory " $tmpdir_client/script
+ fatal "ERROR: cannot create temporary directory " $tmpdir_client/script
cat > $tmpdir_client/script/$script_file
else
include_file_or_directory script $script_file > /dev/null
fi
fi
- # Add the necessary info to special files in our temporary directory. Do this
- # after linking in -I and -R directories in order to guarantee no name clashes.
- tmpfile=`mktemp cmdline.XXXXXX` || \
- fatal "ERROR: cannot create temporary file "
- echo "cmdline: $cmdline" > $tmpfile
-
- tmpfile=`mktemp sysinfo.XXXXXX` || \
- fatal "ERROR: cannot create temporary file " $tmpfile
- echo "sysinfo: `client_sysinfo`" > $tmpfile
+ # Add the necessary info to special files in our temporary directory.
+ echo "cmdline: $cmdline" > cmdline
+ echo "sysinfo: `client_sysinfo`" > sysinfo
}
# function client_sysinfo
@@ -467,9 +461,9 @@ function unpack_response {
#
# Find and establish connection with a compatible stap server.
function find_and_connect_to_server {
- cd $tmpdir_client
# Use a temp file here instead of a pipeline so that the side effects
# of choose_server are seen by the rest of this script.
+ cd $tmpdir_client
stap-find-servers > servers
choose_server < servers
rm -fr servers
diff --git a/stap-server b/stap-server
index 7df324b4..e825c49a 100755
--- a/stap-server
+++ b/stap-server
@@ -146,20 +146,20 @@ function check_compatibility {
# function: read_data_file PREFIX
#
-# Find a file whose name matches '$1.??????' whose first line
+# Find a file whose name is '$1' and whose first line
# contents are '$1: .*'. Read and echo the first line.
function read_data_file {
- for f in `ls $1.??????`
- do
- read < $f
- line=$REPLY
- data=`expr "$line" : "$1: \\\(.*\\\)"`
- if test "X$data" != "X"; then
- echo $data
- return
- fi
- done
- fatal "ERROR: Data file for $1 not found"
+ test -f $1 || \
+ fatal "ERROR: Data file $1 not found"
+
+ read < $1
+ line=$REPLY
+ data=`expr "$line" : "$1: \\\(.*\\\)"`
+ if test "X$data" != "X"; then
+ echo $data
+ return
+ fi
+ fatal "ERROR: Data in file $1 is incorrect"
}
# function: parse_options [ STAP-OPTIONS ]