Skip to content

Commit

Permalink
Fix for win32.
Browse files Browse the repository at this point in the history
git-svn-id: file:///mnt/fast/tau2git/svnroot/trunk/tau2@2662 a8e31b63-e6ca-409b-a01b-2eec1b506579
  • Loading branch information
amorris committed Sep 1, 2004
1 parent 01c3181 commit b7f3a39
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions utils/tau_merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ int getdtablesize(void);
#include <io.h>
#include "getopt.h"
#else
#define O_BINARY 0
#include <unistd.h>
#endif
#endif
Expand Down Expand Up @@ -394,7 +395,7 @@ int main(int argc, char *argv[])
for (i=optind; i<argc-1; i++)
{
/* -- open input trace -------------------------------------------------- */
if ( (trcdes[numtrc].fd = open (argv[i], O_RDONLY)) < 0 )
if ( (trcdes[numtrc].fd = open (argv[i], O_RDONLY | O_BINARY)) < 0 )
{
perror (argv[i]);
errflag = TRUE;
Expand Down Expand Up @@ -506,7 +507,7 @@ int main(int argc, char *argv[])
fprintf (stderr, "%s exists; override [y]? ", trcfile);
if ( getchar() == 'n' ) exit (1);
}
if ( (outfd = open (trcfile, O_WRONLY|O_CREAT|O_TRUNC, 0644)) < 0 )
if ( (outfd = open (trcfile, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644)) < 0 )
{
perror (trcfile);
exit (1);
Expand Down Expand Up @@ -591,7 +592,7 @@ int main(int argc, char *argv[])
/* -- if file was closed during the search for barriers, re-open it ----- */
if ( trcdes[i].fd = -1 )
{
if ( (trcdes[i].fd = open (trcdes[i].name, O_RDONLY)) < 0 )
if ( (trcdes[i].fd = open (trcdes[i].name, O_RDONLY|O_BINARY)) < 0 )
{
perror (argv[i]);
exit (1);
Expand Down

0 comments on commit b7f3a39

Please sign in to comment.