Removed definitions for O_BINARY and O_TEXT, and patched the few files that used them.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38962 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Scott McCreary
2010-10-13 06:26:53 +00:00
parent 0d6d8db9ab
commit 8f0c2a388c
6 changed files with 14 additions and 10 deletions
-2
View File
@@ -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 */
@@ -64,11 +64,11 @@ ParallelTransport::ParallelTransport(BDirectory* printer, BMessage* msg)
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)
@@ -64,11 +64,11 @@ SerialTransport::SerialTransport(BDirectory* printer, BMessage* msg)
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)
+2 -1
View File
@@ -1484,9 +1484,10 @@ do_system(NODE *tree)
ret = system(cmd);
if (ret != -1)
ret = WEXITSTATUS(ret);
#ifdef O_BINARY
if ((BINMODE & 1) != 0)
os_setbinmode(fileno(stdin), O_BINARY);
#endif
cmd[tmp->stlen] = save;
}
free_temp(tmp);
+6 -1
View File
@@ -894,9 +894,10 @@ close_redir(register struct redirect *rp, int exitwarn, two_way_close_type how)
}
} else if ((rp->flag & (RED_PIPE|RED_WRITE)) == (RED_PIPE|RED_WRITE)) { /* write to pipe */
status = pclose(rp->fp);
#ifdef O_BINARY
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 @@ str2mode(const char *mode)
ret = 0; /* lint */
cant_happen();
}
#ifdef O_BINARY
if (strchr(mode, 'b') != NULL)
ret |= O_BINARY;
#endif
return ret;
}
@@ -2126,8 +2129,10 @@ gawk_popen(const char *cmd, struct redirect *rp)
os_restore_mode(fileno(stdin));
current = popen(cmd, binmode("r"));
#ifdef O_BINARY
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");
+2 -2
View File
@@ -506,7 +506,7 @@ out:
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 @@ out:
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