Browse Source

[master] Merge branch 'master' of ssh://git.bind10.isc.org/var/bind10/git/bind10

JINMEI Tatuya 12 years ago
parent
commit
fbf11f41c3

+ 1 - 1
src/bin/auth/auth_config.cc

@@ -106,7 +106,7 @@ public:
         rollbackAddresses_ = old;
         rollbackAddresses_ = old;
     }
     }
     virtual void commit() {
     virtual void commit() {
-        rollbackAddresses_.release();
+        rollbackAddresses_.reset();
     }
     }
 private:
 private:
     AuthSrv& server_;
     AuthSrv& server_;

+ 1 - 1
src/bin/auth/tests/config_unittest.cc

@@ -130,7 +130,7 @@ TEST_F(AuthConfigTest, invalidListenAddressConfig) {
     isc::testutils::portconfig::invalidListenAddressConfig(server);
     isc::testutils::portconfig::invalidListenAddressConfig(server);
 }
 }
 
 
-// Try setting addresses trough config
+// Try setting addresses through config
 TEST_F(AuthConfigTest, listenAddressConfig) {
 TEST_F(AuthConfigTest, listenAddressConfig) {
     isc::testutils::portconfig::listenAddressConfig(server);
     isc::testutils::portconfig::listenAddressConfig(server);
 
 

+ 4 - 4
src/lib/python/isc/sysinfo/sysinfo.py

@@ -325,8 +325,8 @@ class SysInfoBSD(SysInfoPOSIX):
         except (subprocess.CalledProcessError, OSError):
         except (subprocess.CalledProcessError, OSError):
             self._net_connections = 'Warning: "netstat -nr" command failed.\n'
             self._net_connections = 'Warning: "netstat -nr" command failed.\n'
 
 
-class SysInfoOpenBSD(SysInfoBSD):
-    """OpenBSD implementation of the SysInfo class.
+class SysInfoNetBSD(SysInfoBSD):
+    """NetBSD and OpenBSD implementation of the SysInfo class.
     See the SysInfo class documentation for more information.
     See the SysInfo class documentation for more information.
     """
     """
     def __init__(self):
     def __init__(self):
@@ -502,8 +502,8 @@ def SysInfoFromFactory():
     osname = platform.system()
     osname = platform.system()
     if osname == 'Linux':
     if osname == 'Linux':
         return SysInfoLinux()
         return SysInfoLinux()
-    elif osname == 'OpenBSD':
-        return SysInfoOpenBSD()
+    elif (osname == 'NetBSD') or (osname == 'OpenBSD'):
+        return SysInfoNetBSD()
     elif osname == 'FreeBSD':
     elif osname == 'FreeBSD':
         return SysInfoFreeBSD()
         return SysInfoFreeBSD()
     elif osname == 'Darwin':
     elif osname == 'Darwin':

+ 5 - 5
src/lib/util/unittests/fork.cc

@@ -93,10 +93,10 @@ provide_input(int *read_pipe, const void *input, const size_t length)
 
 
 /*
 /*
  * This creates a pipe, forks and reads the pipe and compares it
  * This creates a pipe, forks and reads the pipe and compares it
- * with given data. Used to check output of run in asynchronous way.
+ * with given data. Used to check output of run in an asynchronous way.
  */
  */
 pid_t
 pid_t
-check_output(int *write_pipe, const void *output, const size_t length)
+check_output(int *write_pipe, const void* const output, const size_t length)
 {
 {
     int pipes[2];
     int pipes[2];
     if (pipe(pipes)) {
     if (pipe(pipes)) {
@@ -109,9 +109,7 @@ check_output(int *write_pipe, const void *output, const size_t length)
         return pid;
         return pid;
     } else {
     } else {
         close(pipes[1]);
         close(pipes[1]);
-        // We don't return the memory, but we're in tests and end this process
-        // right away.
-        unsigned char *buffer = new unsigned char[length + 1];
+        unsigned char* buffer = new unsigned char[length + 1];
         // Try to read one byte more to see if the output ends here
         // Try to read one byte more to see if the output ends here
         size_t got_length(read_data(pipes[0], buffer, length + 1));
         size_t got_length(read_data(pipes[0], buffer, length + 1));
         bool ok(true);
         bool ok(true);
@@ -133,8 +131,10 @@ check_output(int *write_pipe, const void *output, const size_t length)
                 fprintf(stderr, "%02hhx", output_c[i]);
                 fprintf(stderr, "%02hhx", output_c[i]);
             }
             }
             fprintf(stderr, "\n");
             fprintf(stderr, "\n");
+            delete [] buffer;
             exit(1);
             exit(1);
         } else {
         } else {
+            delete [] buffer;
             exit(0);
             exit(0);
         }
         }
     }
     }