]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: fix mingw 5.0.3 compatibility issue
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Thu, 25 Feb 2021 20:44:22 +0000 (20:44 +0000)
committerJason Dillaman <dillaman@redhat.com>
Fri, 26 Feb 2021 00:08:55 +0000 (19:08 -0500)
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>
(cherry picked from commit 7eae54cb4c4ee26fdaff9599a627edd2d281de8a)

src/tools/rbd_wnbd/rbd_wnbd.cc

index b4e94ab692cc1d49b79848bdec36378a0c7d9032..d2bb9d8e96e917c2e9100b81c159de14b2322ac0 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;