diff gcc/ada/terminals.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
line wrap: on
line diff
--- a/gcc/ada/terminals.c	Fri Oct 27 22:46:09 2017 +0900
+++ b/gcc/ada/terminals.c	Thu Oct 25 07:37:49 2018 +0900
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *                     Copyright (C) 2008-2016, AdaCore                     *
+ *                     Copyright (C) 2008-2018, AdaCore                     *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
@@ -29,13 +29,13 @@
  *                                                                          *
  ****************************************************************************/
 
+#define ATTRIBUTE_UNUSED __attribute__((unused))
+
 /* First all usupported platforms. Add stubs for exported routines. */
 
 #if defined (VMS) || defined (__vxworks) || defined (__Lynx__) \
   || defined (__ANDROID__) || defined (__PikeOS__) || defined(__DJGPP__)
 
-#define ATTRIBUTE_UNUSED __attribute__((unused))
-
 void *
 __gnat_new_tty (void)
 {
@@ -1107,14 +1107,6 @@
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
-
-/* On some system termio is either absent or including it will disable termios
-   (HP-UX) */
-#if !defined (__hpux__) && !defined (BSD) && !defined (__APPLE__) \
-  && !defined (__rtems__)
-#   include <termio.h>
-#endif
-
 #include <sys/ioctl.h>
 #include <termios.h>
 #include <fcntl.h>
@@ -1130,7 +1122,6 @@
 #   include <sys/signal.h>
 #endif
 #if defined (__hpux__)
-#   include <sys/termio.h>
 #   include <sys/stropts.h>
 #endif
 
@@ -1421,7 +1412,7 @@
 __gnat_setup_child_communication
    (pty_desc *desc,
     char **new_argv,
-    int Use_Pipes)
+    int Use_Pipes ATTRIBUTE_UNUSED)
 {
   int status;
   int pid = getpid ();
@@ -1458,7 +1449,7 @@
 #ifdef TIOCSCTTY
   /* make the tty the controlling terminal */
   if ((status = ioctl (desc->slave_fd, TIOCSCTTY, 0)) == -1)
-    return -1;
+    _exit (1);
 #endif
 
   /* adjust tty settings */
@@ -1480,8 +1471,7 @@
   /* launch the program */
   execvp (new_argv[0], new_argv);
 
-  /* return the pid */
-  return pid;
+  _exit (1);
 }
 
 /* send_signal_via_characters - Send a characters that will trigger a signal
@@ -1598,7 +1588,10 @@
 
 /* __gnat_send_header - dummy function. this interface is only used on Windows */
 void
-__gnat_send_header (pty_desc* desc, char header[5], int size, int *ret)
+__gnat_send_header (pty_desc* desc ATTRIBUTE_UNUSED,
+		    char header[5] ATTRIBUTE_UNUSED,
+		    int size ATTRIBUTE_UNUSED,
+		    int *ret ATTRIBUTE_UNUSED)
 {
   *ret = 0;
 }