update from texinfo
[gnulib.git] / tests / test-fseeko.c
index 1b4c9e8..e33620f 100644 (file)
 #include <sys/types.h>
 
 int
-main ()
+main (int argc, char **argv)
 {
-  off_t pos = fseeko (stdin, (off_t)0, SEEK_CUR);
-  (void)pos;
-
-  return 0;
+  /* Assume stdin is seekable iff argc > 1.  */
+  int expected = argc > 1 ? 0 : -1;
+  /* Exit with success only if fseek/fseeko agree.  */
+  int r1 = fseeko (stdin, (off_t)0, SEEK_CUR);
+  int r2 = fseek (stdin, (long)0, SEEK_CUR);
+  return ! (r1 == r2 && r1 == expected);
 }