mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 20:47:27 +03:00
vere: export term.c:_write() as u3_write_fd(), use in dprintf() replacement
This commit is contained in:
parent
f06471cb31
commit
0ddde0b0d6
@ -1364,6 +1364,10 @@
|
|||||||
void
|
void
|
||||||
u3_king_grab(void* ptr_v);
|
u3_king_grab(void* ptr_v);
|
||||||
|
|
||||||
|
/* u3_write_fd(): retry interrupts, continue partial writes, assert errors.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
u3_write_fd(c3_i fid_i, const void* buf_v, size_t len_i);
|
||||||
|
|
||||||
c3_w
|
c3_w
|
||||||
u3_readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
|
u3_readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
|
||||||
|
@ -28,10 +28,10 @@ static void _term_read_cb(uv_stream_t* tcp_u,
|
|||||||
static c3_i _term_tcsetattr(c3_i, c3_i, const struct termios*);
|
static c3_i _term_tcsetattr(c3_i, c3_i, const struct termios*);
|
||||||
static void _term_it_send_stub(u3_utty* uty_u, u3_noun tub);
|
static void _term_it_send_stub(u3_utty* uty_u, u3_noun tub);
|
||||||
|
|
||||||
/* _write(): retry interrupts, continue partial writes, assert errors.
|
/* u3_write_fd(): retry interrupts, continue partial writes, assert errors.
|
||||||
*/
|
*/
|
||||||
static void
|
void
|
||||||
_write(c3_i fid_i, const void* buf_v, size_t len_i)
|
u3_write_fd(c3_i fid_i, const void* buf_v, size_t len_i)
|
||||||
{
|
{
|
||||||
ssize_t ret_i;
|
ssize_t ret_i;
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ _write(c3_i fid_i, const void* buf_v, size_t len_i)
|
|||||||
|
|
||||||
// assert on true errors
|
// assert on true errors
|
||||||
//
|
//
|
||||||
// NB: can't call u3l_log here or we would re-enter _write()
|
// NB: can't call u3l_log here or we would re-enter u3_write_fd()
|
||||||
//
|
//
|
||||||
if ( ret_i < 0 ) {
|
if ( ret_i < 0 ) {
|
||||||
fprintf(stderr, "term: write failed %s\r\n", strerror(errno));
|
fprintf(stderr, "term: write failed %s\r\n", strerror(errno));
|
||||||
@ -253,7 +253,7 @@ u3_term_log_exit(void)
|
|||||||
if ( -1 == fcntl(uty_u->fid_i, F_SETFL, uty_u->cug_i) ) {
|
if ( -1 == fcntl(uty_u->fid_i, F_SETFL, uty_u->cug_i) ) {
|
||||||
c3_assert(!"exit-fcntl");
|
c3_assert(!"exit-fcntl");
|
||||||
}
|
}
|
||||||
_write(uty_u->fid_i, "\r\n", 2);
|
u3_write_fd(uty_u->fid_i, "\r\n", 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user