Skip to content

Commit

Permalink
Revert "fix #19600 No error checking on fclose (#19836)"
Browse files Browse the repository at this point in the history
This reverts commit 04e4a5e.
  • Loading branch information
ringabout committed Sep 2, 2022
1 parent 2a34d14 commit f86a294
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
6 changes: 2 additions & 4 deletions lib/std/syncio.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
10 changes: 0 additions & 10 deletions tests/misc/t19600.nim

This file was deleted.

0 comments on commit f86a294

Please sign in to comment.