From 4e12b1a2a9e68685dff61acaee1e1f6c377d978c Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 23 Dec 2008 23:36:47 +0000 Subject: libbb: introduce and use xmalloc_ttyname (-32 in bss). ash: small code shrink text data bss dec hex filename 793669 504 7524 801697 c3ba1 busybox_old 793659 504 7492 801655 c3b77 busybox_unstripped --- selinux/sestatus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'selinux') diff --git a/selinux/sestatus.c b/selinux/sestatus.c index 2166296..1a02a6b 100644 --- a/selinux/sestatus.c +++ b/selinux/sestatus.c @@ -114,7 +114,8 @@ static void display_verbose(void) /* files contexts */ puts("\nFile contexts:"); - cterm = ttyname(0); + cterm = xmalloc_ttyname(0); +//FIXME: if cterm == NULL, we segfault!?? puts(cterm); if (cterm && lgetfilecon(cterm, &con) >= 0) { printf(COL_FMT "%s\n", "Controlling term:", con); @@ -122,7 +123,7 @@ static void display_verbose(void) freecon(con); } - for (i=0; fc[i] != NULL; i++) { + for (i = 0; fc[i] != NULL; i++) { struct stat stbuf; if (lgetfilecon(fc[i], &con) < 0) -- cgit v1.1