diff options
author | Christophe Grenier <[email protected]> | 2008-04-11 11:35:24 +0200 |
---|---|---|
committer | Christophe Grenier <[email protected]> | 2008-04-11 11:37:43 +0200 |
commit | ef4cf90c9405b38b39ec1b033cd17e5a0f4eb65e (patch) | |
tree | 3ebaec8d7d55302292c2b08d0752613518e3aef8 | |
parent | 6f0d64c5615f46efd67b7db15f540a0839f90615 (diff) |
Avoid unused variable when not using sudo
-rw-r--r-- | src/intrf.c | 28 |
1 files 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 |