summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
}
}