Define YYOBJ in terms of YYFILES
[deliverable/binutils-gdb.git] / gdb / remote-fileio.c
index 252b423bfabc43a46c375b582037bea4132b2683..877189382c49e1ba7f04b910b3972100b53d04a2 100644 (file)
@@ -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,20 +1187,18 @@ remote_fileio_request (char *buf, int ctrlc_pending_p)
     }
   else
     {
-      ex = catch_exceptions (current_uiout,
-                            do_remote_fileio_request, (void *)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);
        }
+      END_CATCH
     }
 
   quit_handler = remote_fileio_o_quit_handler;
@@ -1272,7 +1269,7 @@ remote_fileio_to_host_stat (struct fio_stat *fst, struct stat *st)
 \f
 
 static void
-set_system_call_allowed (char *args, int from_tty)
+set_system_call_allowed (const char *args, int from_tty)
 {
   if (args)
     {
@@ -1289,7 +1286,7 @@ set_system_call_allowed (char *args, int from_tty)
 }
 
 static void
-show_system_call_allowed (char *args, int from_tty)
+show_system_call_allowed (const char *args, int from_tty)
 {
   if (args)
     error (_("Garbage after \"show remote "
This page took 0.02473 seconds and 4 git commands to generate.