Ticket #6705: O_BINARY.diff
File O_BINARY.diff, 4.1 KB (added by , 14 years ago) |
---|
-
src/add-ons/print/transports/parallel_port/ParallelTransport.cpp
64 64 address[size] = 0; // make sure string is 0-terminated 65 65 66 66 strcat(strcpy(device, "/dev/parallel/"), address); 67 fFile = open(device, O_RDWR | O_EXCL | O_BINARY, 0);67 fFile = open(device, O_RDWR | O_EXCL, 0); 68 68 if (fFile < 0) { 69 69 // Try unidirectional access mode 70 70 bidirectional = false; 71 fFile = open(device, O_WRONLY | O_EXCL | O_BINARY, 0);71 fFile = open(device, O_WRONLY | O_EXCL, 0); 72 72 } 73 73 74 74 if (fFile < 0) -
src/add-ons/print/transports/serial_port/SerialTransport.cpp
64 64 address[size] = 0; // make sure string is 0-terminated 65 65 66 66 strcat(strcpy(device, "/dev/ports/"), address); 67 fFile = open(device, O_RDWR | O_EXCL | O_BINARY, 0);67 fFile = open(device, O_RDWR | O_EXCL, 0); 68 68 if (fFile < 0) { 69 69 // Try unidirectional access mode 70 70 bidirectional = false; 71 fFile = open(device, O_WRONLY | O_EXCL | O_BINARY, 0);71 fFile = open(device, O_WRONLY | O_EXCL, 0); 72 72 } 73 73 74 74 if (fFile < 0) -
src/bin/gawk/builtin.c
1484 1484 ret = system(cmd); 1485 1485 if (ret != -1) 1486 1486 ret = WEXITSTATUS(ret); 1487 #ifndef __HAIKU__ 1487 1488 if ((BINMODE & 1) != 0) 1488 1489 os_setbinmode(fileno(stdin), O_BINARY); 1489 1490 #endif 1490 1491 cmd[tmp->stlen] = save; 1491 1492 } 1492 1493 free_temp(tmp); -
src/bin/gawk/io.c
894 894 } 895 895 } else if ((rp->flag & (RED_PIPE|RED_WRITE)) == (RED_PIPE|RED_WRITE)) { /* write to pipe */ 896 896 status = pclose(rp->fp); 897 #ifndef __HAIKU__ 897 898 if ((BINMODE & 1) != 0) 898 899 os_setbinmode(fileno(stdin), O_BINARY); 899 900 #endif 900 901 rp->fp = NULL; 901 902 } else if (rp->fp != NULL) { /* write to file */ 902 903 status = fclose(rp->fp); … … 1079 1080 ret = 0; /* lint */ 1080 1081 cant_happen(); 1081 1082 } 1083 #ifndef __HAIKU__ 1082 1084 if (strchr(mode, 'b') != NULL) 1083 1085 ret |= O_BINARY; 1086 #endif 1084 1087 return ret; 1085 1088 } 1086 1089 … … 2126 2129 2127 2130 os_restore_mode(fileno(stdin)); 2128 2131 current = popen(cmd, binmode("r")); 2132 #ifndef __HAIKU__ 2129 2133 if ((BINMODE & 1) != 0) 2130 2134 os_setbinmode(fileno(stdin), O_BINARY); 2135 #endif 2131 2136 if (current == NULL) 2132 2137 return NULL; 2133 2138 os_close_on_exec(fileno(current), cmd, "pipe", "from"); -
src/bin/gawk/main.c
506 506 else /* PRE_ASSIGN_FS */ 507 507 cmdline_fs(preassigns[i].val); 508 508 free(preassigns); 509 509 #ifdef O_BINARY 510 510 if ((BINMODE & 1) != 0) 511 511 if (os_setbinmode(fileno(stdin), O_BINARY) == -1) 512 512 fatal(_("can't set binary mode on stdin (%s)"), strerror(errno)); … … 516 516 if (os_setbinmode(fileno(stderr), O_BINARY) == -1) 517 517 fatal(_("can't set binary mode on stderr (%s)"), strerror(errno)); 518 518 } 519 519 #endif 520 520 #ifdef GAWKDEBUG 521 521 setbuf(stdout, (char *) NULL); /* make debugging easier */ 522 522 #endif -
headers/posix/fcntl.h
48 48 #define O_NONBLOCK 0x00000080 /* non blocking io */ 49 49 #define O_NDELAY O_NONBLOCK 50 50 #define O_APPEND 0x00000800 /* to end of file */ 51 #define O_TEXT 0x00004000 /* CR-LF translation */52 #define O_BINARY 0x00008000 /* no translation */53 51 #define O_SYNC 0x00010000 /* write synchronized I/O file integrity */ 54 52 #define O_RSYNC 0x00020000 /* read synchronized I/O file integrity */ 55 53 #define O_DSYNC 0x00040000 /* write synchronized I/O data integrity */