gettimeofday: port recent C++ fix to Emacs
[gnulib.git] / tests / test-sigpipe.c
index e1c19a5..e09294a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of SIGPIPE handling.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008-2013 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,8 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -52,18 +51,18 @@ main (int argc, char **argv)
       char c[2] = { 'y', '\n' };
       int ret = write (1, c, sizeof (c));
       if (ret <= 0)
-       {
-         switch (mode)
-           {
-           case 'B': /* The write() call should have failed with EPIPE.  */
-             if (ret < 0 && errno == EPIPE)
-               exit (0);
-             /*FALLTHROUGH*/
-           case 'A': /* The process should silently die.  */
-           case 'C': /* The handler should have been called.  */
-             fprintf (stderr, "write() returned %d with error %d.\n", ret, errno);
-             exit (1);
-           }
-       }
+        {
+          switch (mode)
+            {
+            case 'B': /* The write() call should have failed with EPIPE.  */
+              if (ret < 0 && errno == EPIPE)
+                exit (0);
+              /*FALLTHROUGH*/
+            case 'A': /* The process should silently die.  */
+            case 'C': /* The handler should have been called.  */
+              fprintf (stderr, "write() returned %d with error %d.\n", ret, errno);
+              exit (1);
+            }
+        }
     }
 }