summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/__gettod.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libcsupport/src/__gettod.c')
-rw-r--r--cpukit/libcsupport/src/__gettod.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/cpukit/libcsupport/src/__gettod.c b/cpukit/libcsupport/src/__gettod.c
index fdf6014799..05db4ab9d0 100644
--- a/cpukit/libcsupport/src/__gettod.c
+++ b/cpukit/libcsupport/src/__gettod.c
@@ -21,6 +21,7 @@
#include <sys/time.h>
#include <errno.h>
#include <rtems.h>
+#include <rtems/seterr.h>
#if defined(RTEMS_NEWLIB) && !defined(HAVE_GETTIMEOFDAY)
/*
@@ -32,16 +33,13 @@ int gettimeofday(
)
{
/* struct timezone* tzp = (struct timezone*) __tz; */
- if ( !tp ) {
- errno = EFAULT;
- return -1;
- }
+ if ( !tp )
+ rtems_set_errno_and_return_minus_one( EFAULT );
/*
* POSIX does not seem to allow for not having a TOD so we just
* grab the time of day.
*/
-
_TOD_Get_timeval( tp );
/*