[rtems commit] libnetworking: Typo
Sebastian Huber
sebh at rtems.org
Thu Mar 6 08:39:32 UTC 2014
Module: rtems
Branch: master
Commit: a418b2f8b0c2c044e20e4f406d561abe3e9780d2
Changeset: http://git.rtems.org/rtems/commit/?id=a418b2f8b0c2c044e20e4f406d561abe3e9780d2
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Mon Mar 3 08:38:10 2014 +0100
libnetworking: Typo
---
cpukit/libnetworking/rtems/rtems_syscall.c | 2 +-
testsuites/libtests/syscall01/init.c | 22 +++++++++++++++++++++-
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/cpukit/libnetworking/rtems/rtems_syscall.c b/cpukit/libnetworking/rtems/rtems_syscall.c
index b221578..324a634 100644
--- a/cpukit/libnetworking/rtems/rtems_syscall.c
+++ b/cpukit/libnetworking/rtems/rtems_syscall.c
@@ -820,7 +820,7 @@ static const rtems_filesystem_file_handlers_r socket_handlers = {
.lseek_h = rtems_filesystem_default_lseek,
.fstat_h = rtems_bsdnet_fstat,
.ftruncate_h = rtems_filesystem_default_ftruncate,
- .fstat_h = rtems_filesystem_default_fsync_or_fdatasync,
+ .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
.fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
.fcntl_h = rtems_bsdnet_fcntl,
.kqfilter_h = rtems_filesystem_default_kqfilter,
diff --git a/testsuites/libtests/syscall01/init.c b/testsuites/libtests/syscall01/init.c
index 8b63348..1e0d27e 100644
--- a/testsuites/libtests/syscall01/init.c
+++ b/testsuites/libtests/syscall01/init.c
@@ -39,19 +39,39 @@ static void test(void)
int rv;
char buf [1];
ssize_t n;
- int fd = open(open_driver_path, O_RDWR);
+ int fd;
+
+ fd = open(open_driver_path, O_RDWR);
rtems_test_assert(fd >= 0);
+ errno = 0;
n = send(fd, buf, sizeof(buf), 0);
rtems_test_assert(n == -1);
rtems_test_assert(errno == ENOTSOCK);
+ errno = 0;
n = recv(fd, buf, sizeof(buf), 0);
rtems_test_assert(n == -1);
rtems_test_assert(errno == ENOTSOCK);
rv = close(fd);
rtems_test_assert(rv == 0);
+
+ fd = socket(PF_INET, SOCK_DGRAM, 0);
+ rtems_test_assert(fd >= 0);
+
+ errno = 0;
+ rv = fsync(fd);
+ rtems_test_assert(rv == -1);
+ rtems_test_assert(errno == EINVAL);
+
+ errno = 0;
+ rv = fdatasync(fd);
+ rtems_test_assert(rv == -1);
+ rtems_test_assert(errno == EINVAL);
+
+ rv = close(fd);
+ rtems_test_assert(rv == 0);
}
static void Init(rtems_task_argument arg)
More information about the vc
mailing list