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

Commit b5d7f94e authored by Colin Cross's avatar Colin Cross
Browse files

Fix sched_param initialization for musl libc

Musl libc defines struct sched_param with multiple fields, use an
empty initializer to initialize them all to default values instead
of trying to zero initialize a single field.  Fixes a build error
with USE_HOST_MUSL=true:
frameworks/native/services/sensorservice/aidl/SensorManager.cpp:204:38: error: missing field '__reserved1' initializer [-Werror,-Wmissing-field-initializers]
struct sched_param p = {0};

Test: m USE_HOST_MUSL=true libsensorserviceaidl
Change-Id: Ie36c59f802f393b1e71f058d7d2a00c64eb6b09e
parent 30a1ac67
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -201,7 +201,7 @@ sp<Looper> SensorManagerAidl::getLooper() {
        // if thread not initialized, start thread
        mStopThread = false;
        std::thread pollThread{[&stopThread = mStopThread, looper = mLooper, javaVm = mJavaVm] {
            struct sched_param p = {0};
            struct sched_param p = {};
            p.sched_priority = 10;
            if (sched_setscheduler(0 /* current thread*/, SCHED_FIFO, &p) != 0) {
                LOG(ERROR) << "Could not use SCHED_FIFO for looper thread: " << strerror(errno);