fix(camera,sms,dwm): fix CAMSS AXI frame-boundary stop, SMS draft button label, and post-reboot softkey responsiveness
This commit is contained in:
@@ -450,8 +450,28 @@ static int xdrawer_run_main(int argc, char** argv) {
|
||||
std::string pidPath = getRuntimeFile("xdrawer.pid");
|
||||
|
||||
int existingDaemon = readIntFile(daemonPidPath, -1);
|
||||
bool daemonAlive = false;
|
||||
if (existingDaemon > 0 && existingDaemon != static_cast<int>(::getpid()) &&
|
||||
::kill(existingDaemon, 0) == 0) {
|
||||
char cmdPath[64];
|
||||
std::snprintf(cmdPath, sizeof(cmdPath), "/proc/%d/cmdline", existingDaemon);
|
||||
int cfd = ::open(cmdPath, O_RDONLY | O_CLOEXEC);
|
||||
if (cfd >= 0) {
|
||||
char cbuf[256];
|
||||
ssize_t cn = ::read(cfd, cbuf, sizeof(cbuf) - 1);
|
||||
::close(cfd);
|
||||
if (cn > 0) {
|
||||
for (ssize_t i = 0; i < cn; ++i) {
|
||||
if (cbuf[i] == '\0') cbuf[i] = ' ';
|
||||
}
|
||||
cbuf[cn] = '\0';
|
||||
if (std::strstr(cbuf, "xdrawer") != nullptr) {
|
||||
daemonAlive = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (daemonAlive) {
|
||||
if (!isPreload) {
|
||||
int ffd = ::open(fifoPath.c_str(), O_WRONLY | O_NONBLOCK | O_CLOEXEC);
|
||||
if (ffd >= 0) {
|
||||
|
||||
Reference in New Issue
Block a user