hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit c337aa83b0788958e434a2a3786adf2b9b9f7f51
parent 455ed760ef4d743d5793d4d9d912577f334e308e
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri, 10 Feb 2023 13:10:18 +0100

io::copy: use fallback if unsupported

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Mio/copy.ha | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/io/copy.ha b/io/copy.ha @@ -11,7 +11,15 @@ export fn copy(dest: handle, src: handle) (error | size) = { match (dest) { case let fd: file => if (src is file) { - return fd_copy(fd, src as file); + match (fd_copy(fd, src as file)) { + case let err: error => + if (!(err is errors::unsupported)) { + return err; + }; + // Use fallback + case let z: size => + return z; + }; }; return copy_fallback(dest, src); case let st: *stream =>