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

Commit 612ca9c6 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by android code review
Browse files

Merge "Fix shutdown sequence to avoid SIGSEGV when running am command"

parents 5f77f82e 33d1ffac
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -752,7 +752,9 @@ finish:

status_t IPCThreadState::talkWithDriver(bool doReceive)
{
    ALOG_ASSERT(mProcess->mDriverFD >= 0, "Binder driver is not opened");
    if (mProcess->mDriverFD <= 0) {
        return -EBADF;
    }
    
    binder_write_read bwr;
    
@@ -808,6 +810,9 @@ status_t IPCThreadState::talkWithDriver(bool doReceive)
#else
        err = INVALID_OPERATION;
#endif
        if (mProcess->mDriverFD <= 0) {
            err = -EBADF;
        }
        IF_LOG_COMMANDS() {
            alog << "Finished read/write, write size = " << mOut.dataSize() << endl;
        }
@@ -1099,7 +1104,9 @@ void IPCThreadState::threadDestructor(void *st)
	if (self) {
		self->flushCommands();
#if defined(HAVE_ANDROID_OS)
        if (self->mProcess->mDriverFD > 0) {
            ioctl(self->mProcess->mDriverFD, BINDER_THREAD_EXIT, 0);
        }
#endif
		delete self;
	}