diff options
author | Dave Brolley <brolley@redhat.com> | 2009-06-15 11:56:31 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-06-15 11:56:31 -0400 |
commit | c3a47b9b2c204849646eda60e6fff9ea7625f122 (patch) | |
tree | c4f80dca27dc0e1cbd544e720b3ac1fbe2e57425 | |
parent | d4d8b581532460c89895a751df5ef64e5e5088e6 (diff) | |
download | systemtap-steved-c3a47b9b2c204849646eda60e6fff9ea7625f122.tar.gz systemtap-steved-c3a47b9b2c204849646eda60e6fff9ea7625f122.tar.xz systemtap-steved-c3a47b9b2c204849646eda60e6fff9ea7625f122.zip |
Ensure signature file exists before copying it to the temp directory.
-rw-r--r-- | main.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -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 } } |