diff options
author | Janne Blomqvist <jb@gcc.gnu.org> | 2011-05-14 10:55:51 +0300 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2011-05-14 10:55:51 +0300 |
commit | 1028b2bded33a9ee92db6a1a968258f3ba29aa24 (patch) | |
tree | cd0c97323c6980b35b95ce189ac0bdc597d9c4dc /libgfortran/runtime/pause.c | |
parent | b4224aec547b9e01f0b79d65c31c7b6da998b8cd (diff) | |
download | gcc-1028b2bded33a9ee92db6a1a968258f3ba29aa24.zip gcc-1028b2bded33a9ee92db6a1a968258f3ba29aa24.tar.gz gcc-1028b2bded33a9ee92db6a1a968258f3ba29aa24.tar.bz2 |
Error printing thread safety, remove GFORTRAN_USE_STDERR
From-SVN: r173749
Diffstat (limited to 'libgfortran/runtime/pause.c')
-rw-r--r-- | libgfortran/runtime/pause.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/libgfortran/runtime/pause.c b/libgfortran/runtime/pause.c index 61ab4db..0e3c8ae 100644 --- a/libgfortran/runtime/pause.c +++ b/libgfortran/runtime/pause.c @@ -1,8 +1,8 @@ -/* Implementation of the STOP statement. - Copyright 2002, 2005, 2007, 2009, 2010 Free Software Foundation, Inc. +/* Implementation of the PAUSE statement. + Copyright 2002, 2005, 2007, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Paul Brook <paul@nowt.org> -This file is part of the GNU Fortran 95 runtime library (libgfortran). +This file is part of the GNU Fortran runtime library (libgfortran). Libgfortran is free software; you can redistribute it and/or modify it under the terms of the GNU General Public @@ -25,18 +25,19 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" #include <string.h> +#include <unistd.h> static void do_pause (void) { char buff[4]; - st_printf ("To resume execution, type go. " - "Other input will terminate the job.\n"); + estr_write ("To resume execution, type go. " + "Other input will terminate the job.\n"); fgets(buff, 4, stdin); if (strncmp(buff, "go\n", 3) != 0) stop_string ('\0', 0); - st_printf ("RESUMED\n"); + estr_write ("RESUMED\n"); } /* A numeric PAUSE statement. */ @@ -59,10 +60,11 @@ export_proto(pause_string); void pause_string (char *string, GFC_INTEGER_4 len) { - st_printf ("PAUSE "); - while (len--) - st_printf ("%c", *(string++)); - st_printf ("\n"); + estr_write ("PAUSE "); + ssize_t w = write (STDERR_FILENO, string, len); + (void) sizeof (w); /* Avoid compiler warning about not using write + return val. */ + estr_write ("\n"); do_pause (); } |