From 78c706ab71fd3be2743c0f65c8096d79c168606d Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 1 Jan 2020 12:24:50 +0100 Subject: [PATCH] Revert "enable macos syscalls" This reverts commit d226fa7b17f8d0e6a3c6f9792e0c6f8e8e38006c. --- vlib/os/os.v | 4 ++-- vlib/os/os_nix.v | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/vlib/os/os.v b/vlib/os/os.v index a3e058e994..739983c06a 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -329,8 +329,8 @@ pub fn (f mut File) close() { return } f.opened = false - //$if linux { - $if linux_or_macos { + $if linux { + //$if linux_or_macos { C.syscall(sys_close, f.fd) return } diff --git a/vlib/os/os_nix.v b/vlib/os/os_nix.v index 4583af71fb..6b4ae7aab3 100644 --- a/vlib/os/os_nix.v +++ b/vlib/os/os_nix.v @@ -68,8 +68,8 @@ pub fn is_dir(path string) bool { */ pub fn open(path string) ?File { - //$if linux { - $if linux_or_macos { + $if linux { + //$if linux_or_macos { fd := C.syscall(sys_open, path.str, 511) if fd == -1 { return error('failed to open file "$path"') @@ -95,8 +95,8 @@ pub fn open(path string) ?File { // create creates a file at a specified location and returns a writable `File` object. pub fn create(path string) ?File { - //$if linux { - $if linux_or_macos { + $if linux { + //$if linux_or_macos { mut fd := 0 //println('creat SYS') $if macos { @@ -134,8 +134,8 @@ pub fn (f mut File) write(s string) { if !f.opened { return } - //$if linux { - $if linux_or_macos { + $if linux { + //$if linux_or_macos { C.syscall(sys_write, f.fd, s.str, s.len) return } @@ -148,8 +148,8 @@ pub fn (f mut File) writeln(s string) { if !f.opened { return } - $if linux_or_macos { - //$if linux { + //$if linux_or_macos { + $if linux { snl := s + '\n' C.syscall(sys_write, f.fd, snl.str, snl.len) return