mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-01 11:11:56 +00:00
Fix #3208
This commit is contained in:
parent
7bb5f39495
commit
fb04e33acc
14
libr/io/io.c
14
libr/io/io.c
@ -647,19 +647,21 @@ R_API int r_io_write(RIO *io, const ut8 *buf, int len) {
|
||||
if (io->plugin) {
|
||||
if (io->plugin->write) {
|
||||
ret = io->plugin->write (io, io->desc, buf, len);
|
||||
} else {
|
||||
} else {
|
||||
eprintf ("r_io_write: io handler with no write callback\n");
|
||||
ret = -1;
|
||||
}
|
||||
} else {
|
||||
if (io->desc) {
|
||||
ret = write (io->desc->fd, buf, len);
|
||||
} else ret = -1;
|
||||
ret = io->desc? write (io->desc->fd, buf, len): -1;
|
||||
}
|
||||
if (ret == -1) {
|
||||
if (io->cached != 2) {
|
||||
eprintf ("r_io_write: cannot write on fd %d\n",
|
||||
io->desc? io->desc->fd: -1);
|
||||
eprintf ("r_io_write: cannot write %d bytes "
|
||||
"at 0x%"PFMT64x" (file=%s, fd=%d)\n",
|
||||
len, io->off,
|
||||
io->desc ? io->desc->uri : "unknown",
|
||||
io->desc ? io->desc->fd : -1);
|
||||
eprintf ("hint: try oo+ or e io.cache=true\n");
|
||||
r_io_cache_invalidate (io, io->off, io->off+1);
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user