# freebsd: fix flags for opening files · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/52be7d7404acf2eff53d5c0cfd3ddeb591a5e27c)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 52be7d7404acf2eff53d5c0cfd3ddeb591a5e27c

Requested commit: 52be7d7404acf2eff53d5c0cfd3ddeb591a5e27c

Commit: 52be7d7404acf2eff53d5c0cfd3ddeb591a5e27c

Tree: 312534f55ce13dc88001a0d549541076088bcd36

Author: Marcio Giaxa

Committer: Marcio Giaxa

## Message

````
freebsd: fix flags for opening files

Prior to this fix, the compare-outputs test suite was showing a strange
behavior, the tests always stopped between tests 6-8 and had a stack track
similar to each other.

```
Test 8/68 compare-output multiple files with private function (ReleaseSmall)...OK
/usr/home/mgxm/dev/zig/zig-cache/source.zig:7:2: error: invalid token: '&'
}&(getStdOut() catch unreachable).outStream().stream;
 ^
The following command exited with error code 1:

```

With the wrong O_* flags, the source code was being written in append mode which
resulted in an invalid file

```zig
use @import("foo.zig");
use @import("bar.zig");

pub fn main() void {
	foo_function();
	bar_function();
}&(getStdOut() catch unreachable).outStream().stream;
	stdout.print("OK 2\n") catch unreachable;
}

fn privateFunction() void {
	printText();
}
```

````

## Parents

- [de473d442371c943bff077428b3786885cadec47](https://git.cafe/gitcafe/zig/commit/de473d442371c943bff077428b3786885cadec47?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/52be7d7404acf2eff53d5c0cfd3ddeb591a5e27c?format=markdown)
