Commit 56b81ea7 authored by Shinichiro Hamaji's avatar Shinichiro Hamaji

Style fixes for consistency

parent ebf81ac4
......@@ -306,21 +306,19 @@ static void MyUserNameInitializer() {
g_my_user_name = user;
} else {
#if defined(HAVE_PWD_H) && defined(HAVE_UNISTD_H)
uid_t uid;
struct passwd pwd;
struct passwd*result = NULL;
struct passwd* result = NULL;
char buffer[1024] = {'\0'};
uid = geteuid();
int pwuid_res = getpwuid_r(uid, &pwd, buffer, sizeof (buffer), &result);
if(pwuid_res == 0) {
uid_t uid = geteuid();
int pwuid_res = getpwuid_r(uid, &pwd, buffer, sizeof(buffer), &result);
if (pwuid_res == 0) {
g_my_user_name = pwd.pw_name;
}
else {
} else {
snprintf(buffer, sizeof(buffer), "uid%d", uid);
g_my_user_name = buffer;
}
#endif
if(g_my_user_name.empty()) {
if (g_my_user_name.empty()) {
g_my_user_name = "invalid-user";
}
}
......
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