s/fileno\(stdin\)/STDIN_FILENO/g
s/fileno\(stdout\)/STDOUT_FILENO/g
diff --git a/archival/gunzip.c b/archival/gunzip.c
index dec53f6..2c4dc49 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -98,7 +98,7 @@
optind++;
if (old_path == NULL || strcmp(old_path, "-") == 0) {
- src_fd = fileno(stdin);
+ src_fd = STDIN_FILENO;
opt |= GUNZIP_OPT_STDOUT;
} else {
src_fd = bb_xopen(old_path, O_RDONLY);
@@ -119,7 +119,7 @@
if (opt & GUNZIP_OPT_TEST) {
dst_fd = bb_xopen("/dev/null", O_WRONLY); /* why does test use filenum 2 ? */
} else if (opt & GUNZIP_OPT_STDOUT) {
- dst_fd = fileno(stdout);
+ dst_fd = STDOUT_FILENO;
} else {
char *extension;
@@ -178,10 +178,10 @@
delete_path = new_path;
}
- if (dst_fd != fileno(stdout)) {
+ if (dst_fd != STDOUT_FILENO) {
close(dst_fd);
}
- if (src_fd != fileno(stdin)) {
+ if (src_fd != STDIN_FILENO) {
close(src_fd);
}