diff options
Diffstat (limited to 'gdb/remote-fileio.c')
-rw-r--r-- | gdb/remote-fileio.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c index f3e33ec..9d1a923 100644 --- a/gdb/remote-fileio.c +++ b/gdb/remote-fileio.c @@ -1118,10 +1118,9 @@ static struct { { NULL, NULL } }; -static int -do_remote_fileio_request (struct ui_out *uiout, void *buf_arg) +static void +do_remote_fileio_request (char *buf) { - char *buf = (char *) buf_arg; char *c; int idx; @@ -1135,10 +1134,10 @@ do_remote_fileio_request (struct ui_out *uiout, void *buf_arg) for (idx = 0; remote_fio_func_map[idx].name; ++idx) if (!strcmp (remote_fio_func_map[idx].name, buf)) break; - if (!remote_fio_func_map[idx].name) /* ERROR: No such function. */ - return RETURN_ERROR; - remote_fio_func_map[idx].func (c); - return 0; + if (!remote_fio_func_map[idx].name) + remote_fileio_reply (-1, FILEIO_ENOSYS); + else + remote_fio_func_map[idx].func (c); } /* Close any open descriptors, and reinitialize the file mapping. */ @@ -1188,22 +1187,16 @@ remote_fileio_request (char *buf, int ctrlc_pending_p) } else { - ex = catch_exceptions (current_uiout, - [&] (ui_out *uiout) - { - return do_remote_fileio_request (uiout, buf); - }, - RETURN_MASK_ALL); - switch (ex) + TRY { - case RETURN_ERROR: - remote_fileio_reply (-1, FILEIO_ENOSYS); - break; - case RETURN_QUIT: - remote_fileio_reply (-1, FILEIO_EINTR); - break; - default: - break; + do_remote_fileio_request (buf); + } + CATCH (ex, RETURN_MASK_ALL) + { + if (ex.reason == RETURN_QUIT) + remote_fileio_reply (-1, FILEIO_EINTR); + else + remote_fileio_reply (-1, FILEIO_EIO); } } |