From ef4cf90c9405b38b39ec1b033cd17e5a0f4eb65e Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Fri, 11 Apr 2008 11:35:24 +0200 Subject: [PATCH] Avoid unused variable when not using sudo --- src/intrf.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/intrf.c b/src/intrf.c index 6303f24d..48f56659 100644 --- a/src/intrf.c +++ b/src/intrf.c @@ -1331,21 +1331,23 @@ static int intrf_no_disk_ncurses(const char *prog_name) #ifdef HAVE_GETEUID if(geteuid()!=0) { - static const struct MenuItem menuSudo[]= - { - {'S',"Sudo","Use the sudo command to restart as root"}, - {'Q',"Quit",""}, - {0,NULL,NULL} - }; - unsigned int menu=0; - int command; wprintw(stdscr,"You need to be root to use %s.\n", prog_name); #ifdef SUDO_BIN - command = wmenuSelect_ext(stdscr,21, 0, menuSudo, 8, - "SQ", MENU_VERT | MENU_VERT_WARN | MENU_BUTTON, &menu,NULL); - if(command=='s' || command=='S') - return 1; - return 0; + { + static const struct MenuItem menuSudo[]= + { + {'S',"Sudo","Use the sudo command to restart as root"}, + {'Q',"Quit",""}, + {0,NULL,NULL} + }; + unsigned int menu=0; + int command; + command = wmenuSelect_ext(stdscr,21, 0, menuSudo, 8, + "SQ", MENU_VERT | MENU_VERT_WARN | MENU_BUTTON, &menu,NULL); + if(command=='s' || command=='S') + return 1; + return 0; + } #endif } #endif