diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-01-25 19:01:55 +0000 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-10-16 21:26:11 +0100 |
commit | 97c9ed026a7f7efe5fca02c188bcbdbcd7c594e9 (patch) | |
tree | 7bfa40418837c193d108a30e49e0ab02b0338d87 | |
parent | b55d0b92fc536793a877f6073754801a7c3c2dd5 (diff) |
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>
-rw-r--r-- | hw/xwin/winprefs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c index 5d2512e22..dbc5b5228 100644 --- a/hw/xwin/winprefs.c +++ b/hw/xwin/winprefs.c @@ -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(); |