[BusyBox-cvs] busybox/archival bunzip2.c, 1.17, 1.18 cpio.c, 1.15, 1.16 gunzip.c, 1.79, 1.80 rpm2cpio.c, 1.12, 1.13 tar.c, 1.188, 1.189 uncompress.c, 1.3, 1.4 unzip.c, 1.6, 1.7

Erik Andersen andersen at busybox.net
Sat Mar 27 10:02:43 UTC 2004


Update of /var/cvs/busybox/archival
In directory nail:/tmp/cvs-serv8801/busybox/archival

Modified Files:
	bunzip2.c cpio.c gunzip.c rpm2cpio.c tar.c uncompress.c 
	unzip.c 
Log Message:
s/fileno\(stdin\)/STDIN_FILENO/g
s/fileno\(stdout\)/STDOUT_FILENO/g


Index: tar.c
===================================================================
RCS file: /var/cvs/busybox/archival/tar.c,v
retrieving revision 1.188
retrieving revision 1.189
diff -u -d -r1.188 -r1.189
--- a/tar.c	15 Mar 2004 08:28:16 -0000	1.188
+++ b/tar.c	27 Mar 2004 10:02:41 -0000	1.189
@@ -308,7 +308,7 @@
 	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 @@
 	}
 
 #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 */

Index: rpm2cpio.c
===================================================================
RCS file: /var/cvs/busybox/archival/rpm2cpio.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- a/rpm2cpio.c	15 Mar 2004 08:28:16 -0000	1.12
+++ b/rpm2cpio.c	27 Mar 2004 10:02:41 -0000	1.13
@@ -73,7 +73,7 @@
 	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 @@
 	}
 
 	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");
 	}
 

Index: bunzip2.c
===================================================================
RCS file: /var/cvs/busybox/archival/bunzip2.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- a/bunzip2.c	5 Jan 2004 11:49:55 -0000	1.17
+++ b/bunzip2.c	27 Mar 2004 10:02:41 -0000	1.18
@@ -52,7 +52,7 @@
 		/* 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 @@
 	}
 
 	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) {

Index: unzip.c
===================================================================
RCS file: /var/cvs/busybox/archival/unzip.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- a/unzip.c	15 Nov 2003 23:18:59 -0000	1.6
+++ b/unzip.c	27 Mar 2004 10:02:41 -0000	1.7
@@ -135,7 +135,7 @@
 	}
 
 	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);

Index: uncompress.c
===================================================================
RCS file: /var/cvs/busybox/archival/uncompress.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- a/uncompress.c	22 Jun 2003 06:59:34 -0000	1.3
+++ b/uncompress.c	27 Mar 2004 10:02:41 -0000	1.4
@@ -46,7 +46,7 @@
 		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 @@
 
 		/* 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 @@
 			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);
 		}
 

Index: gunzip.c
===================================================================
RCS file: /var/cvs/busybox/archival/gunzip.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- a/gunzip.c	15 Mar 2004 08:28:16 -0000	1.79
+++ b/gunzip.c	27 Mar 2004 10:02:41 -0000	1.80
@@ -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);
 		}
 

Index: cpio.c
===================================================================
RCS file: /var/cvs/busybox/archival/cpio.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- a/cpio.c	15 Mar 2004 08:28:16 -0000	1.15
+++ b/cpio.c	27 Mar 2004 10:02:41 -0000	1.16
@@ -47,7 +47,7 @@
 
 	/* 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;
 




More information about the busybox-cvs mailing list