client/player: Fix printing errors when transport->filename is not set

If transport->filename is not set don't attempt to write to the
transport->fd.
This commit is contained in:
Luiz Augusto von Dentz 2024-07-18 13:58:52 -04:00
parent 025f07ec0d
commit 957c956112

View File

@ -4575,10 +4575,10 @@ static bool transport_recv(struct io *io, void *user_data)
transport->seq++;
if (transport->fd >= 0) {
if (transport->filename) {
len = write(transport->fd, buf, ret);
if (len < 0)
bt_shell_printf("Unable to write: %s (%d)",
bt_shell_printf("Unable to write: %s (%d)\n",
strerror(errno), -errno);
}