Refer to fd#0 and fd#1 with the symbolic constants STDIN_FILENO and
STDOUT_FILENO from <unistd.h>, for better readability.
Signed-off-by: Laszlo Ersek <lersek(a)redhat.com>
---
generator/states-connect.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/generator/states-connect.c b/generator/states-connect.c
index 83d7f316828e..f0020d6f3b26 100644
--- a/generator/states-connect.c
+++ b/generator/states-connect.c
@@ -260,11 +260,11 @@ CONNECT_COMMAND.START:
return 0;
}
if (pid == 0) { /* child - run command */
- close (0);
- close (1);
+ close (STDIN_FILENO);
+ close (STDOUT_FILENO);
close (sv[0]);
- dup2 (sv[1], 0);
- dup2 (sv[1], 1);
+ dup2 (sv[1], STDIN_FILENO);
+ dup2 (sv[1], STDOUT_FILENO);
close (sv[1]);
/* Restore SIGPIPE back to SIG_DFL. */