From c3a47b9b2c204849646eda60e6fff9ea7625f122 Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Mon, 15 Jun 2009 11:56:31 -0400 Subject: Ensure signature file exists before copying it to the temp directory. --- main.cxx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'main.cxx') 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 } } -- cgit