Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54b4246b authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh
Browse files

Fix link error of PROCESS_STATE_NONEXISTENT.

* A reference to PROCESS_STATE_NONEXISTENT will cause link error with
  clang or standard C++ compiler because there is no out-of-class definition,
  although g++ is allowing it.
  Use +PROCESS_STATE_NONEXISTENT to get the value instead of reference.

Change-Id: I62049584b94e6847b64b572f6ef6c3e9dcc573eb
parent 5a23aa94
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -884,7 +884,11 @@ status_t CameraService::handleEvictionsLocked(const String8& cameraId, int clien
        std::vector<int> ownerPids(mActiveClientManager.getAllOwners());
        ownerPids.push_back(clientPid);

        std::vector<int> priorities(ownerPids.size(), PROCESS_STATE_NONEXISTENT);
        // Use the value +PROCESS_STATE_NONEXISTENT, to avoid taking
        // address of PROCESS_STATE_NONEXISTENT as a reference argument
        // for the vector constructor. PROCESS_STATE_NONEXISTENT does
        // not have an out-of-class definition.
        std::vector<int> priorities(ownerPids.size(), +PROCESS_STATE_NONEXISTENT);

        // Get priorites of all active PIDs
        ProcessInfoService::getProcessStatesFromPids(ownerPids.size(), &ownerPids[0],