Browse Source

[1593-sun] Fix errors on Sun build

Sunstudio could not find memset() in cstring; changed the include to
that of "string.h".  Also it complained of an anachronism in using
"extern int close()" as a default argument.  Removed these.
Stephen Morris 13 years ago
parent
commit
0e8c2c9e57

+ 1 - 1
src/bin/sockcreator/main.cc

@@ -24,7 +24,7 @@ main() {
      * but ability to bind ports? It would be nice.
      */
     try {
-        run(STDIN_FILENO, STDOUT_FILENO);
+        run(STDIN_FILENO, STDOUT_FILENO, getSock, isc::util::io::send_fd, close);
     } catch (const SocketCreatorError& ec) {
         return (ec.getExitCode());
     }

+ 3 - 3
src/bin/sockcreator/sockcreator.cc

@@ -18,7 +18,7 @@
 #include <util/io/sockaddr_util.h>
 
 #include <cerrno>
-#include <cstring>
+#include <string.h>
 
 #include <unistd.h>
 #include <sys/types.h>
@@ -216,8 +216,8 @@ getSock(const int type, struct sockaddr* bind_addr, const socklen_t addr_len) {
 
 // Main run loop.
 void
-run(const int input_fd, const int output_fd, const get_sock_t get_sock,
-    const send_fd_t send_fd_fun, const close_t close_fun)
+run(const int input_fd, const int output_fd, get_sock_t get_sock,
+    send_fd_t send_fd_fun, close_t close_fun)
 {
     for (;;) {
         char command;

+ 2 - 4
src/bin/sockcreator/sockcreator.h

@@ -135,10 +135,8 @@ typedef int (*close_t)(int);
 /// \exception isc::socket_creator::ProtocolError Unrecognised command received
 /// \exception isc::socket_creator::InternalError Other error
 void
-run(const int input_fd, const int output_fd,
-    const get_sock_t get_sock_fun = getSock,
-    const send_fd_t send_fd_fun = isc::util::io::send_fd,
-    const close_t close_fun = close);
+run(const int input_fd, const int output_fd, get_sock_t get_sock_fun,
+    send_fd_t send_fd_fun, close_t close_fun);
 
 }   // namespace socket_creator
 }   // NAMESPACE ISC