Ahem: add new faq entry to list at top of FAQ.html
[oweals/busybox.git] / archival / gunzip.c
index dec53f660c53bc7332fbe21a1533ceca67fe1132..beb7bd12eb37bd8464f0d79d34b802ca2ddf5c48 100644 (file)
@@ -12,7 +12,7 @@
  * handling.
  *
  * General cleanup to better adhere to the style guide and make use of standard
- * busybox functions by Glenn McGrath <bug1@optushome.com.au>
+ * busybox functions by Glenn McGrath <bug1@iinet.net.au>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -98,7 +98,7 @@ extern int gunzip_main(int argc, char **argv)
                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 @@ extern int gunzip_main(int argc, char **argv)
                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 @@ extern int gunzip_main(int argc, char **argv)
                        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);
                }