aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/bunzip2.c4
-rw-r--r--archival/cpio.c2
-rw-r--r--archival/gunzip.c8
-rw-r--r--archival/libunarchive/data_extract_to_stdout.c2
-rw-r--r--archival/rpm2cpio.c4
-rw-r--r--archival/tar.c4
-rw-r--r--archival/uncompress.c8
-rw-r--r--archival/unzip.c2
8 files changed, 17 insertions, 17 deletions
diff --git a/archival/bunzip2.c b/archival/bunzip2.c
index e2c3ca91d..ba422723c 100644
--- a/archival/bunzip2.c
+++ b/archival/bunzip2.c
@@ -52,7 +52,7 @@ int bunzip2_main(int argc, char **argv)
/* Open input file */
src_fd = bb_xopen(compressed_name, O_RDONLY);
} else {
- src_fd = fileno(stdin);
+ src_fd = STDIN_FILENO;
opt |= BUNZIP2_OPT_STDOUT;
}
@@ -62,7 +62,7 @@ int bunzip2_main(int argc, char **argv)
}
if (opt & BUNZIP2_OPT_STDOUT) {
- dst_fd = fileno(stdout);
+ dst_fd = STDOUT_FILENO;
} else {
int len = strlen(compressed_name) - 4;
if (strcmp(compressed_name + len, ".bz2") != 0) {
diff --git a/archival/cpio.c b/archival/cpio.c
index aff6a55f9..0fbe7b8e5 100644
--- a/archival/cpio.c
+++ b/archival/cpio.c
@@ -47,7 +47,7 @@ extern int cpio_main(int argc, char **argv)
/* Initialise */
archive_handle = init_handle();
- archive_handle->src_fd = fileno(stdin);
+ archive_handle->src_fd = STDIN_FILENO;
archive_handle->seek = seek_by_char;
archive_handle->flags = ARCHIVE_EXTRACT_NEWER | ARCHIVE_PRESERVE_DATE;
diff --git a/archival/gunzip.c b/archival/gunzip.c
index dec53f660..2c4dc49a4 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -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);
}
diff --git a/archival/libunarchive/data_extract_to_stdout.c b/archival/libunarchive/data_extract_to_stdout.c
index 7c4e7c78b..d4137a1a8 100644
--- a/archival/libunarchive/data_extract_to_stdout.c
+++ b/archival/libunarchive/data_extract_to_stdout.c
@@ -18,5 +18,5 @@
extern void data_extract_to_stdout(archive_handle_t *archive_handle)
{
- bb_copyfd_size(archive_handle->src_fd, fileno(stdout), archive_handle->file_header->size);
+ bb_copyfd_size(archive_handle->src_fd, STDOUT_FILENO, archive_handle->file_header->size);
}
diff --git a/archival/rpm2cpio.c b/archival/rpm2cpio.c
index 7b5059518..5314e5300 100644
--- a/archival/rpm2cpio.c
+++ b/archival/rpm2cpio.c
@@ -73,7 +73,7 @@ extern int rpm2cpio_main(int argc, char **argv)
unsigned char magic[2];
if (argc == 1) {
- rpm_fd = fileno(stdin);
+ rpm_fd = STDIN_FILENO;
} else {
rpm_fd = bb_xopen(argv[1], O_RDONLY);
}
@@ -96,7 +96,7 @@ extern int rpm2cpio_main(int argc, char **argv)
}
check_header_gzip(rpm_fd);
- if (inflate_gunzip(rpm_fd, fileno(stdout)) != 0) {
+ if (inflate_gunzip(rpm_fd, STDOUT_FILENO) != 0) {
bb_error_msg("Error inflating");
}
diff --git a/archival/tar.c b/archival/tar.c
index 2310e80cb..279cbfd46 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -308,7 +308,7 @@ static inline int writeTarHeader(struct TarBallInfo *tbInfo,
if (tbInfo->verboseFlag) {
FILE *vbFd = stdout;
- if (tbInfo->tarFd == fileno(stdout)) /* If the archive goes to stdout, verbose to stderr */
+ if (tbInfo->tarFd == STDOUT_FILENO) /* If the archive goes to stdout, verbose to stderr */
vbFd = stderr;
fprintf(vbFd, "%s\n", header.name);
@@ -883,7 +883,7 @@ int tar_main(int argc, char **argv)
}
#ifdef CONFIG_FEATURE_CLEAN_UP
- if (tar_handle->src_fd != fileno(stdin)) {
+ if (tar_handle->src_fd != STDIN_FILENO) {
close(tar_handle->src_fd);
}
#endif /* CONFIG_FEATURE_CLEAN_UP */
diff --git a/archival/uncompress.c b/archival/uncompress.c
index 2de37d273..48b4e2cad 100644
--- a/archival/uncompress.c
+++ b/archival/uncompress.c
@@ -46,7 +46,7 @@ extern int uncompress_main(int argc, char **argv)
int dst_fd;
if (strcmp(compressed_file, "-") == 0) {
- src_fd = fileno(stdin);
+ src_fd = STDIN_FILENO;
flags |= GUNZIP_TO_STDOUT;
} else {
src_fd = bb_xopen(compressed_file, O_RDONLY);
@@ -60,7 +60,7 @@ extern int uncompress_main(int argc, char **argv)
/* Set output filename and number */
if (flags & GUNZIP_TO_STDOUT) {
- dst_fd = fileno(stdout);
+ dst_fd = STDOUT_FILENO;
} else {
struct stat stat_buf;
char *extension;
@@ -96,10 +96,10 @@ extern int uncompress_main(int argc, char **argv)
delete_path = uncompressed_file;
}
- 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);
}
diff --git a/archival/unzip.c b/archival/unzip.c
index c670073f4..4e357d656 100644
--- a/archival/unzip.c
+++ b/archival/unzip.c
@@ -135,7 +135,7 @@ extern int unzip_main(int argc, char **argv)
}
if (*argv[optind] == '-') {
- archive_handle->src_fd = fileno(stdin);
+ archive_handle->src_fd = STDIN_FILENO;
archive_handle->seek = seek_by_char;
} else {
archive_handle->src_fd = bb_xopen(argv[optind++], O_RDONLY);