summaryrefslogtreecommitdiffstats
path: root/main.cxx
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-06-15 11:56:31 -0400
committerDave Brolley <brolley@redhat.com>2009-06-15 11:56:31 -0400
commitc3a47b9b2c204849646eda60e6fff9ea7625f122 (patch)
treec4f80dca27dc0e1cbd544e720b3ac1fbe2e57425 /main.cxx
parentd4d8b581532460c89895a751df5ef64e5e5088e6 (diff)
downloadsystemtap-steved-c3a47b9b2c204849646eda60e6fff9ea7625f122.tar.gz
systemtap-steved-c3a47b9b2c204849646eda60e6fff9ea7625f122.tar.xz
systemtap-steved-c3a47b9b2c204849646eda60e6fff9ea7625f122.zip
Ensure signature file exists before copying it to the temp directory.
Diffstat (limited to 'main.cxx')
-rw-r--r--main.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/main.cxx b/main.cxx
index 73955f24..56d70b85 100644
--- a/main.cxx
+++ b/main.cxx
@@ -1175,14 +1175,17 @@ main (int argc, char * const argv [])
// Save the signature as well.
assert (! s.cert_db_path.empty());
module_src_path += ".sgn";
- module_dest_path += ".sgn";
-
- if (s.verbose > 1)
- clog << "Copying " << module_src_path << " to "
- << module_dest_path << endl;
- if (copy_file(module_src_path.c_str(), module_dest_path.c_str()) != 0)
- cerr << "Copy failed (\"" << module_src_path << "\" to \""
- << module_dest_path << "\"): " << strerror(errno) << endl;
+ if (file_exists (module_src_path))
+ {
+ module_dest_path += ".sgn";
+
+ if (s.verbose > 1)
+ clog << "Copying " << module_src_path << " to "
+ << module_dest_path << endl;
+ if (copy_file(module_src_path.c_str(), module_dest_path.c_str()) != 0)
+ cerr << "Copy failed (\"" << module_src_path << "\" to \""
+ << module_dest_path << "\"): " << strerror(errno) << endl;
+ }
#endif
}
}