[klibc] [PATCH] cpio: cleanup O_BINARY usage.

maximilian attems max at stro.at
Tue Jun 28 07:13:02 PDT 2011


No point of using it on a unixish OS.

Signed-off-by: maximilian attems <max at stro.at>
---
 usr/utils/cpio.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/usr/utils/cpio.c b/usr/utils/cpio.c
index 6891883..15134b9 100644
--- a/usr/utils/cpio.c
+++ b/usr/utils/cpio.c
@@ -31,10 +31,6 @@
 #include <fnmatch.h>
 #endif
 
-#ifndef	O_BINARY
-# define O_BINARY 0
-#endif
-
 # ifndef DIRECTORY_SEPARATOR
 #  define DIRECTORY_SEPARATOR '/'
 # endif
@@ -576,8 +572,7 @@ static void create_final_defers(void)
 		if (link_res == 0) {
 			continue;
 		}
-		out_file_des = open(d->header.c_name,
-				    O_CREAT | O_WRONLY | O_BINARY, 0600);
+		out_file_des = open(d->header.c_name, O_CREAT | O_WRONLY, 0600);
 		if (out_file_des < 0) {
 			fprintf(stderr, "%s: open %s: %s\n",
 				progname, d->header.c_name, strerror(errno));
@@ -647,8 +642,7 @@ copyin_regular_file(struct new_cpio_header *file_hdr, int in_file_des)
 	}
 
 	/* If not linked, copy the contents of the file.  */
-	out_file_des = open(file_hdr->c_name,
-			    O_CREAT | O_WRONLY | O_BINARY, 0600);
+	out_file_des = open(file_hdr->c_name, O_CREAT | O_WRONLY, 0600);
 
 	if (out_file_des < 0) {
 		fprintf(stderr, "%s: open %s: %s\n",
-- 
1.7.5.4



More information about the klibc mailing list