Update copyright year range in all GDB files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / checkpoint.c
index 13e521319a7eac8657ea5ca209674ef4ba32517f..5484ebeb4056d325ef1e93bbc6120b1b1dfbdcb0 100644 (file)
@@ -1,6 +1,6 @@
 /* This testcase is part of GDB, the GNU debugger.
 
-   Copyright 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright 2005-2019 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
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <unistd.h>
 
 long lines = 0;
 
-main()
+int main()
 {
   char linebuf[128];
   FILE *in, *out;
@@ -28,21 +29,21 @@ main()
   long i;
   int c = 0;
 
-  in  = fopen ("pi.txt", "r");
-  out = fopen ("copy1.txt", "w");
+  in  = fopen (PI_TXT, "r");
+  out = fopen (COPY1_TXT, "w");
 
   if (!in || !out)
     {
       fprintf (stderr, "File open failed\n");
-      exit (1);
+      return 1;
     }
 
   for (i = 0; ; i++)
     {
       if (ftell (in) != i)
-       fprintf (stderr, "Input error at %d\n", i);
+       fprintf (stderr, "Input error at %ld\n", i);
       if (ftell (out) != i)
-       fprintf (stderr, "Output error at %d\n", i);
+       fprintf (stderr, "Output error at %ld\n", i);
       c = fgetc (in);
       if (c == '\n')
        lines++;        /* breakpoint 1 */
@@ -54,6 +55,6 @@ main()
   fclose (in);
   fclose (out);
   printf ("Deleting copy.\n"); /* breakpoint 3 */
-  unlink ("copy1.txt");
-  exit (0);                    /* breakpoint 4 */
+  unlink (COPY1_TXT);
+  return 0;                    /* breakpoint 4 */
 }
This page took 0.029147 seconds and 4 git commands to generate.