| | @@ -38,7 +38,8 @@ |
| 38 | 38 | return load(path, b) = 0; |
| 39 | 39 | end; |
| 40 | 40 | |
| 41 | | -(* Makes the file at path hold data; false if it can't be written. *) |
| 41 | +(* Makes the file at path hold data; false if it can't be written, or |
| 42 | + the close, where a late write error shows, fails. *) |
| 42 | 43 | proc write*(path, data: []U8): BOOL; |
| 43 | 44 | var fd, n, at: INT; |
| 44 | 45 | begin |
| | @@ -51,8 +52,7 @@ |
| 51 | 52 | elsif n # Sys.errIntr then Sys.close(fd); return false; (* a signal broke in: write again *) |
| 52 | 53 | end; |
| 53 | 54 | end; |
| 54 | | - Sys.close(fd); |
| 55 | | - return true; |
| 55 | + return Sys.closeChecked(fd) = 0; (* a write error may come only at the close *) |
| 56 | 56 | end; |
| 57 | 57 | |
| 58 | 58 | (* The module's test. *) |