hw/xwin: Fix shadowed local variable i in HandleCustomWM_COMMAND()

Fix shadowed local variable i in HandleCustomWM_COMMAND()

Also, fds are meant to be representable as an int

winprefs.c: In function ‘HandleCustomWM_COMMAND’:
winprefs.c:346:23: error: declaration of ‘i’ shadows a previous local
winprefs.c:322:7: error: shadowed declaration is here

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
Jon TURNEY 2012-01-25 19:01:55 +00:00
parent b55d0b92fc
commit 97c9ed026a

View File

@ -327,12 +327,12 @@ HandleCustomWM_COMMAND(unsigned long hwndIn, int command)
case CMD_EXEC:
if (fork() == 0) {
struct rlimit rl;
unsigned long i;
int fd;
/* Close any open descriptors except for STD* */
getrlimit(RLIMIT_NOFILE, &rl);
for (i = STDERR_FILENO + 1; i < rl.rlim_cur; i++)
close(i);
for (fd = STDERR_FILENO + 1; fd < rl.rlim_cur; fd++)
close(fd);
/* Disassociate any TTYs */
setsid();