diff options
author | Isaac Dunham <ibid.ag@gmail.com> | 2014-05-25 11:46:58 -0500 |
---|---|---|
committer | Isaac Dunham <ibid.ag@gmail.com> | 2014-05-25 11:46:58 -0500 |
commit | 80a438dd35782db8d3e0bca81ca78dea128f9c37 (patch) | |
tree | 7f3e32e05a02d0103292b976f5b6dc2f00174d10 /toys/other | |
parent | 67ba22986d84b8d793d9bb39d6d7545204924124 (diff) | |
download | toybox-80a438dd35782db8d3e0bca81ca78dea128f9c37.tar.gz |
logname and whoami are the same as id -un, so merge them.
Since the starting letters are greater than those for 'id' or 'groups',
we cn just check if the first letter is greater than 'i'.
Diffstat (limited to 'toys/other')
-rw-r--r-- | toys/other/whoami.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/toys/other/whoami.c b/toys/other/whoami.c deleted file mode 100644 index a7ed047a..00000000 --- a/toys/other/whoami.c +++ /dev/null @@ -1,29 +0,0 @@ -/* whoami.c - Print effective user name - * - * Copyright 2012 Georgi Chorbadzhiyski <georgi@unixsol.org> - -USE_WHOAMI(NEWTOY(whoami, NULL, TOYFLAG_USR|TOYFLAG_BIN)) - -config WHOAMI - bool "whoami" - default y - help - usage: whoami - - Print effective user name. -*/ - -#include "toys.h" - -void whoami_main(void) -{ - struct passwd *pw = getpwuid(geteuid()); - - if (!pw) { - perror("getpwuid"); - toys.exitval = 1; - return; - } - - xputs(pw->pw_name); -} |