]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't fail initialization if socket path returns ENXIO
authorYehuda Sadeh <yehuda@inktank.com>
Wed, 6 Jun 2012 21:42:12 +0000 (14:42 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Mon, 11 Jun 2012 19:56:04 +0000 (12:56 -0700)
ENXIO is expected when trying to read the unix domain socket

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_main.cc

index b6699e778db272a8aaf91317e105c480927b5c05..7c59a5043d24ae5c07bd903bcd16f741d7541097 100644 (file)
@@ -198,10 +198,14 @@ void RGWProcess::run()
     int fd = open(path_str.c_str(), O_CREAT, 0644);
     if (fd < 0) {
       int err = errno;
-      dout(0) << "ERROR: cannot create socket: path=" << path_str << " error=" << cpp_strerror(err) << dendl;
-      return;
+      /* ENXIO is actually expected, we'll get that if we try to open a unix domain socket */
+      if (err != ENXIO) {
+        dout(0) << "ERROR: cannot create socket: path=" << path_str << " error=" << cpp_strerror(err) << dendl;
+        return;
+      }
+    } else {
+      close(fd);
     }
-    close(fd);
 
     const char *path = path_str.c_str();
     s = FCGX_OpenSocket(path, SOCKET_BACKLOG);