Log the errno if calling fork() fails

Test: treehugger
Change-Id: I9d54e3c2c006aaa54a5bc044e39ab5d5e2ff7484
This commit is contained in:
Theodore Dubois
2022-07-27 14:02:51 -07:00
parent 97f0cbd96f
commit 3588c91253

View File

@@ -2127,6 +2127,8 @@ pid_t zygote::ForkCommon(JNIEnv* env, bool is_system_server,
// Reset the fd to the unsolicited zygote socket
gSystemServerSocketFd = -1;
} else if (pid == -1) {
ALOGE("Failed to fork child process: %s (%d)", strerror(errno), errno);
} else {
ALOGD("Forked child process %d", pid);
}