BIND 10 master, updated. 7024914e4253ce983f0dc28f623956ea6c82241e [master] Fix sunstudio error and warnings
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Nov 28 19:39:52 UTC 2012
The branch, master has been updated
via 7024914e4253ce983f0dc28f623956ea6c82241e (commit)
from e8dd780ac88735b31bf3e7df6dd9f4a2b972da94 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7024914e4253ce983f0dc28f623956ea6c82241e
Author: Jelte Jansen <jelte at isc.org>
Date: Wed Nov 28 19:39:07 2012 +0000
[master] Fix sunstudio error and warnings
- add std:: to strerror calls
- clean up and const_cast long_options array
-----------------------------------------------------------------------
Summary of changes:
src/bin/cmdctl/b10-certgen.cc | 37 ++++++++++++++++++++-----------------
1 file changed, 20 insertions(+), 17 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/cmdctl/b10-certgen.cc b/src/bin/cmdctl/b10-certgen.cc
index 96a08ba..579ae60 100644
--- a/src/bin/cmdctl/b10-certgen.cc
+++ b/src/bin/cmdctl/b10-certgen.cc
@@ -171,13 +171,13 @@ public:
std::ofstream key_file(key_file_name.c_str());
if (!key_file.good()) {
print(std::string("Error writing to ") + key_file_name +
- ": " + strerror(errno));
+ ": " + std::strerror(errno));
return (WRITE_ERROR);
}
key_file << PKCS8::PEM_encode(key, rng, "");
if (!key_file.good()) {
print(std::string("Error writing to ") + key_file_name +
- ": " + strerror(errno));
+ ": " + std::strerror(errno));
return (WRITE_ERROR);
}
key_file.close();
@@ -207,13 +207,13 @@ public:
std::ofstream cert_file(cert_file_name.c_str());
if (!cert_file.good()) {
print(std::string("Error writing to ") + cert_file_name +
- ": " + strerror(errno));
+ ": " + std::strerror(errno));
return (WRITE_ERROR);
}
cert_file << cert.PEM_encode();
if (!cert_file.good()) {
print(std::string("Error writing to ") + cert_file_name +
- ": " + strerror(errno));
+ ": " + std::strerror(errno));
return (WRITE_ERROR);
}
cert_file.close();
@@ -278,11 +278,11 @@ public:
// be enumerated in one go
if (fileExists(certfile)) {
if (!fileIsReadable(certfile)) {
- print(certfile + " not readable: " + strerror(errno));
+ print(certfile + " not readable: " + std::strerror(errno));
create_cert = false;
}
if (!fileIsWritable(certfile)) {
- print(certfile + " not writable: " + strerror(errno));
+ print(certfile + " not writable: " + std::strerror(errno));
create_cert = false;
}
}
@@ -290,7 +290,7 @@ public:
// b10-certgen that is)
if (fileExists(keyfile)) {
if (!fileIsWritable(keyfile)) {
- print(keyfile + " not writable: " + strerror(errno));
+ print(keyfile + " not writable: " + std::strerror(errno));
create_cert = false;
}
}
@@ -312,11 +312,11 @@ public:
}
} else {
if (!fileExists(certfile)) {
- print(certfile + ": " + strerror(errno));
+ print(certfile + ": " + std::strerror(errno));
return (NO_SUCH_FILE);
}
if (!fileIsReadable(certfile)) {
- print(certfile + " not readable: " + strerror(errno));
+ print(certfile + " not readable: " + std::strerror(errno));
return (FILE_PERMISSION_ERROR);
}
int result = validateCertificate(certfile);
@@ -360,14 +360,17 @@ main(int argc, char* argv[])
bool certfile_default = true;
bool keyfile_default = true;
- struct option long_options[] = {
- { "certfile", required_argument, 0, 'c' },
- { "force", no_argument, 0, 'f' },
- { "help", no_argument, 0, 'h' },
- { "keyfile", required_argument, 0, 'k' },
- { "write", no_argument, 0, 'w' },
- { "quiet", no_argument, 0, 'q' },
- { 0, 0, 0, 0 }
+ // It would appear some environments insist on
+ // char* here (Sunstudio on Solaris), so we const_cast
+ // them to get rid of compiler warnings.
+ const struct option long_options[] = {
+ { const_cast<char*>("certfile"), required_argument, NULL, 'c' },
+ { const_cast<char*>("force"), no_argument, NULL, 'f' },
+ { const_cast<char*>("help"), no_argument, NULL, 'h' },
+ { const_cast<char*>("keyfile"), required_argument, NULL, 'k' },
+ { const_cast<char*>("write"), no_argument, NULL, 'w' },
+ { const_cast<char*>("quiet"), no_argument, NULL, 'q' },
+ { NULL, 0, NULL, 0 }
};
int opt, option_index;
More information about the bind10-changes
mailing list