Unverified Commit 242130d3 authored by Sergiu Deitsch's avatar Sergiu Deitsch Committed by GitHub

Merge pull request #350 from TheModMaker/fixIosSim

Allow getpwuid_r to return missing entry.
parents 1a4c47a7 a606c318
......@@ -31,6 +31,7 @@ Fumitoshi Ukai <ukai@google.com>
Guillaume Dumont <dumont.guillaume@gmail.com>
Håkan L. S. Younes <hyounes@google.com>
Ivan Penkov <ivanpe@google.com>
Jacob Trimble <modmaker@google.com>
Jim Ray <jimray@google.com>
Michael Tanner <michael@tannertaxpro.com>
MiniLight <MiniLightAR@Gmail.com>
......
......@@ -311,7 +311,7 @@ static void MyUserNameInitializer() {
char buffer[1024] = {'\0'};
uid_t uid = geteuid();
int pwuid_res = getpwuid_r(uid, &pwd, buffer, sizeof(buffer), &result);
if (pwuid_res == 0) {
if (pwuid_res == 0 && result) {
g_my_user_name = pwd.pw_name;
} else {
snprintf(buffer, sizeof(buffer), "uid%d", uid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment