I got this: rexec.c:189: error: parse error before '&' token
The line is: int stdin = STDIN_FILENO; The variable 'stdin' is reserved by POSIX: http://www.opengroup.org/onlinepubs/9699919799/functions/stdin.html Patch below pushed. /Simon >From fe2ee0162ba862e061a05fadbd1b23e3b2b07caf Mon Sep 17 00:00:00 2001 From: Simon Josefsson <[email protected]> Date: Mon, 7 Dec 2009 13:24:12 +0100 Subject: [PATCH] Don't use reserved variable 'stdin'. --- ChangeLog | 4 ++++ rexec/rexec.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8a5da11..d537134 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-12-07 Simon Josefsson <[email protected]> + * rexec/rexec.c (do_rexec): Don't use reserved variable 'stdin'. + +2009-12-07 Simon Josefsson <[email protected]> + * NEWS: Mention that man pages are generated using help2man. * configure.ac: Check for LN_S. * man/Makefile.am: Rewrite using skeleton rules. Add man pages diff --git a/rexec/rexec.c b/rexec/rexec.c index 524b121..3a1e17f 100644 --- a/rexec/rexec.c +++ b/rexec/rexec.c @@ -186,7 +186,7 @@ do_rexec (struct arguments *arguments) char port_str[6]; struct sockaddr_in addr; struct hostent *host; - int stdin = STDIN_FILENO; + int stdin_fd = STDIN_FILENO; int err_sock = -1; sock = socket (AF_INET, SOCK_STREAM, 0); @@ -270,18 +270,18 @@ do_rexec (struct arguments *arguments) FD_ZERO (&rsocks); if (0 <= sock) FD_SET (sock, &rsocks); - if (0 <= stdin) - FD_SET (stdin, &rsocks); + if (0 <= stdin_fd) + FD_SET (stdin_fd, &rsocks); if (0 <= err_sock) FD_SET (err_sock, &rsocks); - ret = select (MAX3 (sock, stdin, err_sock) + 1, &rsocks, NULL, NULL, NULL); + ret = select (MAX3 (sock, stdin_fd, err_sock) + 1, &rsocks, NULL, NULL, NULL); if (ret == -1) error (EXIT_FAILURE, errno, "error select"); - if (0 <= stdin && FD_ISSET (stdin, &rsocks)) + if (0 <= stdin_fd && FD_ISSET (stdin_fd, &rsocks)) { - err = read (stdin, buffer, 1024); + err = read (stdin_fd, buffer, 1024); if (err < 0) error (EXIT_FAILURE, errno, "error reading stdin"); @@ -289,8 +289,8 @@ do_rexec (struct arguments *arguments) if (!err) { shutdown (sock, SHUT_WR); - close (stdin); - stdin = -1; + close (stdin_fd); + stdin_fd = -1; continue; } -- 1.6.5.3
