summaryrefslogtreecommitdiffstats
path: root/src/intrf.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-04-11 11:35:24 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2008-04-11 11:37:43 +0200
commitef4cf90c9405b38b39ec1b033cd17e5a0f4eb65e (patch)
tree3ebaec8d7d55302292c2b08d0752613518e3aef8 /src/intrf.c
parent6f0d64c5615f46efd67b7db15f540a0839f90615 (diff)
Avoid unused variable when not using sudo
Diffstat (limited to 'src/intrf.c')
-rw-r--r--src/intrf.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/intrf.c b/src/intrf.c
index 6303f24..48f5665 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