(main,allocate_memory) [_WIN32]: switch the default file mode to
binary to match POSIX. Remove the now unneccessary ifdef for the open.
This commit is contained in:
parent
331aac2afa
commit
c3ac61e1e4
1 changed files with 6 additions and 8 deletions
|
@ -194,6 +194,10 @@ main(int argc, char *argv[])
|
||||||
char tbuf[512];
|
char tbuf[512];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
_fmode = _O_BINARY;
|
||||||
|
#endif
|
||||||
|
|
||||||
rnd_seed = time(NULL);
|
rnd_seed = time(NULL);
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "ae:ioqs:R:")) != EOF) {
|
while ((opt = getopt(argc, argv, "ae:ioqs:R:")) != EOF) {
|
||||||
|
@ -407,14 +411,8 @@ allocate_memory(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
#if !defined(_WIN32)
|
the_file = open(empfile[EF_SECTOR].file, O_RDWR | O_CREAT | O_TRUNC,
|
||||||
the_file =
|
0660);
|
||||||
open(empfile[EF_SECTOR].file, O_RDWR | O_CREAT | O_TRUNC, 0660);
|
|
||||||
#else
|
|
||||||
the_file =
|
|
||||||
open(empfile[EF_SECTOR].file,
|
|
||||||
O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0660);
|
|
||||||
#endif
|
|
||||||
if (the_file < 0) {
|
if (the_file < 0) {
|
||||||
perror(empfile[EF_SECTOR].file);
|
perror(empfile[EF_SECTOR].file);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue