Index: src/add-ons/print/transports/parallel_port/ParallelTransport.cpp
===================================================================
--- src/add-ons/print/transports/parallel_port/ParallelTransport.cpp	(revision 38948)
+++ src/add-ons/print/transports/parallel_port/ParallelTransport.cpp	(working copy)
@@ -64,11 +64,11 @@
 	address[size] = 0; // make sure string is 0-terminated
 		
 	strcat(strcpy(device, "/dev/parallel/"), address);
-	fFile = open(device, O_RDWR | O_EXCL | O_BINARY, 0);
+	fFile = open(device, O_RDWR | O_EXCL, 0);
 	if (fFile < 0) {
 		// Try unidirectional access mode
 		bidirectional = false;
-		fFile = open(device, O_WRONLY | O_EXCL | O_BINARY, 0);
+		fFile = open(device, O_WRONLY | O_EXCL, 0);
 	}
 
 	if (fFile < 0)
Index: src/add-ons/print/transports/serial_port/SerialTransport.cpp
===================================================================
--- src/add-ons/print/transports/serial_port/SerialTransport.cpp	(revision 38948)
+++ src/add-ons/print/transports/serial_port/SerialTransport.cpp	(working copy)
@@ -64,11 +64,11 @@
 	address[size] = 0; // make sure string is 0-terminated
 		
 	strcat(strcpy(device, "/dev/ports/"), address);
-	fFile = open(device, O_RDWR | O_EXCL | O_BINARY, 0);
+	fFile = open(device, O_RDWR | O_EXCL, 0);
 	if (fFile < 0) {
 		// Try unidirectional access mode
 		bidirectional = false;
-		fFile = open(device, O_WRONLY | O_EXCL | O_BINARY, 0);
+		fFile = open(device, O_WRONLY | O_EXCL, 0);
 	}
 
 	if (fFile < 0)
Index: src/bin/gawk/builtin.c
===================================================================
--- src/bin/gawk/builtin.c	(revision 38948)
+++ src/bin/gawk/builtin.c	(working copy)
@@ -1484,9 +1484,10 @@
 		ret = system(cmd);
 		if (ret != -1)
 			ret = WEXITSTATUS(ret);
+#ifndef __HAIKU__
 		if ((BINMODE & 1) != 0)
 			os_setbinmode(fileno(stdin), O_BINARY);
-
+#endif
 		cmd[tmp->stlen] = save;
 	}
 	free_temp(tmp);
Index: src/bin/gawk/io.c
===================================================================
--- src/bin/gawk/io.c	(revision 38948)
+++ src/bin/gawk/io.c	(working copy)
@@ -894,9 +894,10 @@
 		}
 	} else if ((rp->flag & (RED_PIPE|RED_WRITE)) == (RED_PIPE|RED_WRITE)) { /* write to pipe */
 		status = pclose(rp->fp);
+#ifndef __HAIKU__
 		if ((BINMODE & 1) != 0)
 			os_setbinmode(fileno(stdin), O_BINARY);
-
+#endif
 		rp->fp = NULL;
 	} else if (rp->fp != NULL) {	/* write to file */
 		status = fclose(rp->fp);
@@ -1079,8 +1080,10 @@
 		ret = 0;		/* lint */
 		cant_happen();
 	}
+#ifndef __HAIKU__
 	if (strchr(mode, 'b') != NULL)
 		ret |= O_BINARY;
+#endif
 	return ret;
 }
 
@@ -2126,8 +2129,10 @@
 
 	os_restore_mode(fileno(stdin));
 	current = popen(cmd, binmode("r"));
+#ifndef __HAIKU__
 	if ((BINMODE & 1) != 0)
 		os_setbinmode(fileno(stdin), O_BINARY);
+#endif
 	if (current == NULL)
 		return NULL;
 	os_close_on_exec(fileno(current), cmd, "pipe", "from");
Index: src/bin/gawk/main.c
===================================================================
--- src/bin/gawk/main.c	(revision 38948)
+++ src/bin/gawk/main.c	(working copy)
@@ -506,7 +506,7 @@
 		else	/* PRE_ASSIGN_FS */
 			cmdline_fs(preassigns[i].val);
 	free(preassigns);
-
+#ifdef O_BINARY
 	if ((BINMODE & 1) != 0)
 		if (os_setbinmode(fileno(stdin), O_BINARY) == -1)
 			fatal(_("can't set binary mode on stdin (%s)"), strerror(errno));
@@ -516,7 +516,7 @@
 		if (os_setbinmode(fileno(stderr), O_BINARY) == -1)
 			fatal(_("can't set binary mode on stderr (%s)"), strerror(errno));
 	}
-
+#endif
 #ifdef GAWKDEBUG
 	setbuf(stdout, (char *) NULL);	/* make debugging easier */
 #endif
Index: headers/posix/fcntl.h
===================================================================
--- headers/posix/fcntl.h	(revision 38948)
+++ headers/posix/fcntl.h	(working copy)
@@ -48,8 +48,6 @@
 #define	O_NONBLOCK		0x00000080	/* non blocking io */
 #define	O_NDELAY		O_NONBLOCK
 #define O_APPEND		0x00000800	/* to end of file */
-#define O_TEXT			0x00004000	/* CR-LF translation */
-#define O_BINARY		0x00008000	/* no translation */
 #define O_SYNC			0x00010000	/* write synchronized I/O file integrity */
 #define O_RSYNC			0x00020000	/* read synchronized I/O file integrity */
 #define O_DSYNC			0x00040000	/* write synchronized I/O data integrity */
