mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Fix tty_write to return error code (negative value) in error case
This commit is contained in:
parent
5045ca1768
commit
e73ff6d208
2 changed files with 2 additions and 2 deletions
|
|
@ -288,7 +288,7 @@ int execute_shell_command(int fd, const char *command)
|
|||
close(pipe_fd[WRITE_END]);
|
||||
while ( (bytes = read(pipe_fd[READ_END], buf, sizeof(buf))) > 0)
|
||||
{
|
||||
if (tty_write(fd, buf, bytes) <= 0)
|
||||
if (tty_write(fd, buf, bytes) < 0)
|
||||
{
|
||||
tio_warning_printf("Could not write to tty device");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ ssize_t tty_write(int fd, void *buffer, size_t count)
|
|||
{
|
||||
// Error
|
||||
tio_debug_printf("Write error (%s)", strerror(errno));
|
||||
break;
|
||||
return retval;
|
||||
}
|
||||
bytes_written += retval;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue