From 80a438dd35782db8d3e0bca81ca78dea128f9c37 Mon Sep 17 00:00:00 2001 From: Isaac Dunham Date: Sun, 25 May 2014 11:46:58 -0500 Subject: 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'. --- toys/other/whoami.c | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 toys/other/whoami.c (limited to 'toys/other') 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 - -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); -} -- cgit v1.2.3