]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: fix mingw 5.0.3 compatibility issue 39707/head
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Thu, 25 Feb 2021 20:44:22 +0000 (20:44 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Thu, 25 Feb 2021 20:47:23 +0000 (20:47 +0000)
GetOverlappedResultEx isn't avaialable when using mingw 5.0.3
(default on Ubuntu Bionic).

Since we don't really need the extra parameters, we'll switch
to GetOverlappedResult.

We're doing this mostly for testing purposes as the mingw 5.0.3
runtime is known to be broken.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
src/tools/rbd_wnbd/rbd_wnbd.cc

index a4b0cf29bd0ff738ca83917cdc4018e518b764d1..d882807da1ed1d888718e53a228bab1fa273014e 100644 (file)
@@ -402,8 +402,7 @@ int map_device_using_suprocess(std::string arguments, int timeout_ms)
   status = WaitForMultipleObjects(2, wait_events, FALSE, timeout_ms);
   switch(status) {
     case WAIT_OBJECT_0:
-      if (!GetOverlappedResultEx(pipe_handle, &connect_o,
-                                 &bytes_read, timeout_ms, TRUE)) {
+      if (!GetOverlappedResult(pipe_handle, &connect_o, &bytes_read, TRUE)) {
         err = GetLastError();
         derr << "Couln't establish a connection with the child process. "
              << "Error: " << win32_strerror(err) << dendl;
@@ -440,8 +439,7 @@ int map_device_using_suprocess(std::string arguments, int timeout_ms)
   status = WaitForMultipleObjects(2, wait_events, FALSE, timeout_ms);
   switch(status) {
     case WAIT_OBJECT_0:
-      if (!GetOverlappedResultEx(pipe_handle, &read_o,
-                                 &bytes_read, timeout_ms, TRUE)) {
+      if (!GetOverlappedResult(pipe_handle, &read_o, &bytes_read, TRUE)) {
         err = GetLastError();
         derr << "Receiving child process reply failed with: "
              << win32_strerror(err) << dendl;