Skip to content

Commit

Permalink
hw/xwin: Fix shadowed local variable i in HandleCustomWM_COMMAND()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Colin Harrison <[email protected]>
  • Loading branch information
jon-turney committed Oct 16, 2012
1 parent b55d0b9 commit 97c9ed0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hw/xwin/winprefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 97c9ed0

Please sign in to comment.