From 2e1a80563b56ecfee0306bf724b264115ca751a1 Mon Sep 17 00:00:00 2001 From: Rui Abreu Ferreira Date: Thu, 14 May 2015 09:38:25 +0100 Subject: os_get_user_name() for non UNIX system #2729 os_get_user_name() requires getuid(), which is only available in UNIX. Return FAIL for non UNIX systems. On FAIL os_get_user_name() fills the buffer with the uid. In Windows libuv uses 0 for uid in stat structs, so 0 is used here too. --- src/nvim/os/users.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/nvim/os/users.c') diff --git a/src/nvim/os/users.c b/src/nvim/os/users.c index a57ba41af1..637a86c74f 100644 --- a/src/nvim/os/users.c +++ b/src/nvim/os/users.c @@ -41,7 +41,12 @@ int os_get_usernames(garray_T *users) // Return OK if a name found. int os_get_user_name(char *s, size_t len) { +#ifdef UNIX return os_get_uname(getuid(), s, len); +#else + // TODO(equalsraf): Windows GetUserName() + return os_get_uname(0, s, len); +#endif } // Insert user name for "uid" in s[len]. -- cgit