diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-08-07 19:46:49 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-08-07 19:46:49 -0700 |
commit | c46898c74e39fc56e67e5bc03c574a3144362634 (patch) | |
tree | f24abdd7ef45ab336ee3e631acd2b173b99a71b3 | |
parent | b7d944377a6674e7fd8c6236f2b957a31c2eccde (diff) | |
download | txr-c46898c74e39fc56e67e5bc03c574a3144362634.tar.gz txr-c46898c74e39fc56e67e5bc03c574a3144362634.tar.bz2 txr-c46898c74e39fc56e67e5bc03c574a3144362634.zip |
streams: a few close funtions should return t.
* socket.c (dgram_close): Return t when a
descriptor is closed, returning nil only when
the object is already in a closed state.
* stream.c (dev_null_close, dir_close): Likewise.
-rw-r--r-- | socket.c | 3 | ||||
-rw-r--r-- | stream.c | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -567,9 +567,10 @@ static val dgram_close(val stream, val throw_on_error) close(d->fd); d->fd = -1; d->err = 0; + return t; } - return t; + return nil; } static val dgram_get_prop(val stream, val ind) @@ -459,6 +459,7 @@ static val dev_null_close(val stream, val throw_on_error) if (n->fd != -1) { close(n->fd); n->fd = -1; + return t; } return nil; } @@ -1847,6 +1848,7 @@ static val dir_close(val stream, val throw_on_error) if (h->d != 0) { closedir(coerce(DIR *, h->d)); h->d = 0; + return t; } return nil; |