summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-08 07:46:10 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-08 07:46:10 +0200
commitf820f22cf02d5fb08802f91fb31efaa51f63e58a (patch)
tree654339f1b099b0d3711456eaada5f9911809c1e6
parent9baffdf7e462676de6cb68e4ec364d0a19471964 (diff)
downloadrtems-f820f22cf02d5fb08802f91fb31efaa51f63e58a.tar.bz2
fstests/fsfseeko01: Fix for long == off_t
Close #2317.
-rw-r--r--testsuites/fstests/fsfseeko01/init.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/testsuites/fstests/fsfseeko01/init.c b/testsuites/fstests/fsfseeko01/init.c
index ef92d10ff3..dd073ce86a 100644
--- a/testsuites/fstests/fsfseeko01/init.c
+++ b/testsuites/fstests/fsfseeko01/init.c
@@ -62,10 +62,17 @@ static void test(void)
rtems_test_assert(rv == 0);
rtems_test_assert(errno == 0);
- errno = 0;
- actual_long_off = ftell(file);
- rtems_test_assert(actual_long_off == -1L);
- rtems_test_assert(errno == EOVERFLOW);
+ if (sizeof(off_t) == sizeof(long)) {
+ errno = 0;
+ actual_long_off = ftell(file);
+ rtems_test_assert(actual_long_off == off);
+ rtems_test_assert(errno == 0);
+ } else {
+ errno = 0;
+ actual_long_off = ftell(file);
+ rtems_test_assert(actual_long_off == -1L);
+ rtems_test_assert(errno == EOVERFLOW);
+ }
errno = 0;
actual_off = ftello(file);