Browse Source

[2447] show the reason of the error when opening IPC lock file fails.

JINMEI Tatuya 12 years ago
parent
commit
ec63a9a5ba
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/lib/util/interprocess_sync_file.cc

+ 4 - 2
src/lib/util/interprocess_sync_file.cc

@@ -15,6 +15,8 @@
 #include "interprocess_sync_file.h"
 
 #include <string>
+#include <cerrno>
+#include <cstring>
 
 #include <stdlib.h>
 #include <string.h>
@@ -68,8 +70,8 @@ InterprocessSyncFile::do_lock(int cmd, short l_type) {
 
         if (fd_ == -1) {
             isc_throw(InterprocessSyncFileError,
-                      "Unable to use interprocess sync lockfile: " +
-                      lockfile_path);
+                      "Unable to use interprocess sync lockfile ("
+                      << std::strerror(errno) << "): " << lockfile_path);
         }
     }