VirtualBox

Changeset 58302 in vbox for trunk/src/VBox/Runtime/r3/posix


Ignore:
Timestamp:
Oct 18, 2015 10:44:23 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103498
Message:

localipc-posix.cpp: rtSocketListen should be done when creating the server, not in the misnamed RTLocalIpcServerListen method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/localipc-posix.cpp

    r58301 r58302  
    248248                        if (RT_SUCCESS(rc))
    249249                        {
    250                             LogFlow(("RTLocalIpcServerCreate: Created %p (%s)\n", pThis, pThis->Name.sun_path));
    251                             *phServer = pThis;
    252                             return VINF_SUCCESS;
     250                            rc = rtSocketListen(pThis->hSocket, pThis->fFlags & RTLOCALIPC_FLAGS_MULTI_SESSION ? 10 : 0);
     251                            if (RT_SUCCESS(rc))
     252                            {
     253                                LogFlow(("RTLocalIpcServerCreate: Created %p (%s)\n", pThis, pThis->Name.sun_path));
     254                                *phServer = pThis;
     255                                return VINF_SUCCESS;
     256                            }
     257                            unlink(pThis->Name.sun_path);
    253258                        }
    254259                    }
     
    401406            for (;;)
    402407            {
    403                 if (pThis->fCancelled)
     408                if (!pThis->fCancelled)
    404409                {
    405                     rc = VERR_CANCELLED;
    406                     break;
    407                 }
    408 
    409                 rc = RTCritSectLeave(&pThis->CritSect);
    410                 AssertRCBreak(rc);
    411 
    412                 rc = rtSocketListen(pThis->hSocket, pThis->fFlags & RTLOCALIPC_FLAGS_MULTI_SESSION ? 10 : 0);
    413                 if (RT_SUCCESS(rc))
    414                 {
     410                    rc = RTCritSectLeave(&pThis->CritSect);
     411                    AssertRCBreak(rc);
     412
    415413                    struct sockaddr_un  Addr;
    416414                    size_t              cbAddr = sizeof(Addr);
     
    457455                else
    458456                {
    459                     int rc2 = RTCritSectEnter(&pThis->CritSect);
    460                     AssertRCBreakStmt(rc2, rc = RT_SUCCESS(rc) ? rc2 : rc);
    461                     if (   rc != VERR_INTERRUPTED
    462                         && rc != VERR_TRY_AGAIN)
    463                         break;
     457                    rc = VERR_CANCELLED;
     458                    break;
    464459                }
    465460            }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette