aboutsummaryrefslogtreecommitdiff
path: root/coreutils/whoami.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/whoami.c')
-rw-r--r--coreutils/whoami.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/coreutils/whoami.c b/coreutils/whoami.c
index 78d20db14..f7ac7aa6d 100644
--- a/coreutils/whoami.c
+++ b/coreutils/whoami.c
@@ -16,11 +16,21 @@
16int whoami_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 16int whoami_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
17int whoami_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) 17int whoami_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
18{ 18{
19#if ENABLE_PLATFORM_MINGW32
20 char buf[64];
21 DWORD len = 64;
22#endif
23
19 if (argv[1]) 24 if (argv[1])
20 bb_show_usage(); 25 bb_show_usage();
21 26
27#if ENABLE_PLATFORM_MINGW32
28 GetUserName(buf, &len);
29 puts(buf);
30#else
22 /* Will complain and die if username not found */ 31 /* Will complain and die if username not found */
23 puts(xuid2uname(geteuid())); 32 puts(xuid2uname(geteuid()));
33#endif
24 34
25 return fflush_all(); 35 return fflush_all();
26} 36}