summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-09-03 01:04:58 +0800
committerGitHub <noreply@github.com>2022-09-02 19:04:58 +0200
commit5ff06fd3c284aba49f53caede2bb8981e9109b12 (patch)
treeb23c8b92f2e0f7152196329d3d935f00b10d0192
parent2a34d143ac408df0e3716fbbf53dcca490ef9d49 (diff)
downloadNim-5ff06fd3c284aba49f53caede2bb8981e9109b12.tar.gz
Revert "fix #19600 No error checking on fclose (#19836)" (#20297)
This reverts commit 04e4a5ec0e35fc7e1c346c2d002e8487b4b48cb5.
-rw-r--r--lib/std/syncio.nim6
-rw-r--r--tests/misc/t19600.nim10
2 files changed, 2 insertions, 14 deletions
diff --git a/lib/std/syncio.nim b/lib/std/syncio.nim
index 4eeb1778d..22e981198 100644
--- a/lib/std/syncio.nim
+++ b/lib/std/syncio.nim
@@ -324,9 +324,7 @@ const
 proc close*(f: File) {.tags: [], gcsafe.} =
   ## Closes the file.
   if not f.isNil:
-    let x = c_fclose(f)
-    if x < 0:
-      checkErr(f)
+    discard c_fclose(f)
 
 proc readChar*(f: File): char {.tags: [ReadIOEffect].} =
   ## Reads a single character from the stream `f`. Should not be used in
@@ -691,7 +689,7 @@ when defined(posix) and not defined(nimscript):
 
 proc open*(f: var File, filename: string,
           mode: FileMode = fmRead,
-          bufSize: int = -1): bool {.tags: [], raises: [IOError], benign.} =
+          bufSize: int = -1): bool {.tags: [], raises: [], benign.} =
   ## Opens a file named `filename` with given `mode`.
   ##
   ## Default mode is readonly. Returns true if the file could be opened.
diff --git a/tests/misc/t19600.nim b/tests/misc/t19600.nim
deleted file mode 100644
index 8d3978660..000000000
--- a/tests/misc/t19600.nim
+++ /dev/null
@@ -1,10 +0,0 @@
-discard """
-  targets: "c cpp"
-  disabled: "win"
-  disabled: "osx"
-  disabled: "linux"
-  exitcode: 1
-  outputsub: "No space left on device"
-"""
-
-writeFile("/dev/full", "hello\n")