change log for rtems (2010-06-28)
rtems-vc at rtems.org
rtems-vc at rtems.org
Mon Jun 28 23:12:10 UTC 2010
*joel*:
2010-06-28 Joel Sherrill <joel.sherrill at oarcorp.com>
* libcsupport/include/rtems/error.h, libcsupport/src/error.c: Clean up
so rtems_panic() can be a noreturn method. This eliminates some
unreachable and thus untestable code.
M 1.2467 cpukit/ChangeLog
M 1.11 cpukit/libcsupport/include/rtems/error.h
M 1.23 cpukit/libcsupport/src/error.c
diff -u rtems/cpukit/ChangeLog:1.2466 rtems/cpukit/ChangeLog:1.2467
--- rtems/cpukit/ChangeLog:1.2466 Mon Jun 28 13:48:30 2010
+++ rtems/cpukit/ChangeLog Mon Jun 28 17:13:54 2010
@@ -1,3 +1,9 @@
+2010-06-28 Joel Sherrill <joel.sherrill at oarcorp.com>
+
+ * libcsupport/include/rtems/error.h, libcsupport/src/error.c: Clean up
+ so rtems_panic() can be a noreturn method. This eliminates some
+ unreachable and thus untestable code.
+
2010-06-28 Joel Sherrill <joel.sherrilL at OARcorp.com>
* libcsupport/src/termios.c: Formatting.
diff -u rtems/cpukit/libcsupport/include/rtems/error.h:1.10 rtems/cpukit/libcsupport/include/rtems/error.h:1.11
--- rtems/cpukit/libcsupport/include/rtems/error.h:1.10 Thu Oct 22 06:20:44 2009
+++ rtems/cpukit/libcsupport/include/rtems/error.h Mon Jun 28 17:13:55 2010
@@ -34,22 +34,19 @@
#define RTEMS_ERROR_ABORT (0x10000000) /* err is fatal; panic */
#endif
-#define RTEMS_ERROR_MASK (RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | \
- RTEMS_ERROR_PANIC) /* all */
+#define RTEMS_ERROR_MASK \
+ (RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | RTEMS_ERROR_PANIC) /* all */
const char *rtems_status_text(rtems_status_code);
-int rtems_error(rtems_error_code_t error_code, const char *printf_format, ...);
-#ifdef __GNUC__
-void rtems_panic(const char *printf_format, ...);
-/*
- * We should be able to use this attribute but gcc complains that
- * rtems_panic does in fact return. :(
- *
- * __attribute__ ((__noreturn__));
- */
-#else
-void rtems_panic(const char *printf_format, ...);
-#endif
+int rtems_error(
+ rtems_error_code_t error_code,
+ const char *printf_format,
+ ...
+);
+void rtems_panic(
+ const char *printf_format,
+ ...
+) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
extern int rtems_panic_in_progress;
diff -u rtems/cpukit/libcsupport/src/error.c:1.22 rtems/cpukit/libcsupport/src/error.c:1.23
--- rtems/cpukit/libcsupport/src/error.c:1.22 Mon Oct 12 11:17:37 2009
+++ rtems/cpukit/libcsupport/src/error.c Mon Jun 28 17:13:55 2010
@@ -16,17 +16,17 @@
*
* error_flag can be specified as any of the following:
*
- * RTEMS_ERROR_ERRNO -- include errno text in output
- * RTEMS_ERROR_PANIC -- halts local system after output
- * RTEMS_ERROR_ABORT -- abort after output
+ * RTEMS_ERROR_ERRNO -- include errno text in output
+ * RTEMS_ERROR_PANIC -- halts local system after output
+ * RTEMS_ERROR_ABORT -- abort after output
*
* It can also include a rtems_status value which can be OR'd
* with the above flags. *
*
* EXAMPLE
- * #include <rtems.h>
- * #include <rtems/error.h>
- * rtems_error(0, "stray interrupt %d", intr);
+ * #include <rtems.h>
+ * #include <rtems/error.h>
+ * rtems_error(0, "stray interrupt %d", intr);
*
* EXAMPLE
* if ((status = rtems_task_create(...)) != RTEMS_SUCCCESSFUL)
@@ -54,115 +54,100 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h> /* _exit() */
+#include <unistd.h> /* _exit() */
int rtems_panic_in_progress;
const rtems_assoc_t rtems_status_assoc[] = {
- { "successful completion", RTEMS_SUCCESSFUL, 0 },
- { "returned from a thread", RTEMS_TASK_EXITTED, 0 },
- { "multiprocessing not configured", RTEMS_MP_NOT_CONFIGURED, 0 },
- { "invalid object name", RTEMS_INVALID_NAME, 0 },
- { "invalid object id", RTEMS_INVALID_ID, 0 },
- { "too many", RTEMS_TOO_MANY, 0 },
- { "timed out waiting", RTEMS_TIMEOUT, 0 },
- { "object deleted while waiting", RTEMS_OBJECT_WAS_DELETED, 0 },
- { "specified size was invalid", RTEMS_INVALID_SIZE, 0 },
- { "address specified is invalid", RTEMS_INVALID_ADDRESS, 0 },
- { "number was invalid", RTEMS_INVALID_NUMBER, 0 },
- { "item has not been initialized", RTEMS_NOT_DEFINED, 0 },
- { "resources still outstanding", RTEMS_RESOURCE_IN_USE, 0 },
- { "request not satisfied", RTEMS_UNSATISFIED, 0 },
- { "thread is in wrong state", RTEMS_INCORRECT_STATE, 0 },
- { "thread already in state", RTEMS_ALREADY_SUSPENDED, 0 },
- { "illegal on calling thread", RTEMS_ILLEGAL_ON_SELF, 0 },
- { "illegal for remote object", RTEMS_ILLEGAL_ON_REMOTE_OBJECT, 0 },
- { "called from wrong environment", RTEMS_CALLED_FROM_ISR, 0 },
- { "invalid thread priority", RTEMS_INVALID_PRIORITY, 0 },
- { "invalid date/time", RTEMS_INVALID_CLOCK, 0 },
- { "invalid node id", RTEMS_INVALID_NODE, 0 },
- { "directive not configured", RTEMS_NOT_CONFIGURED, 0 },
- { "not owner of resource", RTEMS_NOT_OWNER_OF_RESOURCE , 0 },
- { "directive not implemented", RTEMS_NOT_IMPLEMENTED, 0 },
- { "RTEMS inconsistency detected", RTEMS_INTERNAL_ERROR, 0 },
- { "could not get enough memory", RTEMS_NO_MEMORY, 0 },
- { "driver IO error", RTEMS_IO_ERROR, 0 },
- { "internal multiprocessing only", THREAD_STATUS_PROXY_BLOCKING, 0 },
- { 0, 0, 0 },
+ { "successful completion", RTEMS_SUCCESSFUL, 0 },
+ { "returned from a thread", RTEMS_TASK_EXITTED, 0 },
+ { "multiprocessing not configured", RTEMS_MP_NOT_CONFIGURED, 0 },
+ { "invalid object name", RTEMS_INVALID_NAME, 0 },
+ { "invalid object id", RTEMS_INVALID_ID, 0 },
+ { "too many", RTEMS_TOO_MANY, 0 },
+ { "timed out waiting", RTEMS_TIMEOUT, 0 },
+ { "object deleted while waiting", RTEMS_OBJECT_WAS_DELETED, 0 },
+ { "specified size was invalid", RTEMS_INVALID_SIZE, 0 },
+ { "address specified is invalid", RTEMS_INVALID_ADDRESS, 0 },
+ { "number was invalid", RTEMS_INVALID_NUMBER, 0 },
+ { "item has not been initialized", RTEMS_NOT_DEFINED, 0 },
+ { "resources still outstanding", RTEMS_RESOURCE_IN_USE, 0 },
+ { "request not satisfied", RTEMS_UNSATISFIED, 0 },
+ { "thread is in wrong state", RTEMS_INCORRECT_STATE, 0 },
+ { "thread already in state", RTEMS_ALREADY_SUSPENDED, 0 },
+ { "illegal on calling thread", RTEMS_ILLEGAL_ON_SELF, 0 },
+ { "illegal for remote object", RTEMS_ILLEGAL_ON_REMOTE_OBJECT, 0 },
+ { "called from wrong environment", RTEMS_CALLED_FROM_ISR, 0 },
+ { "invalid thread priority", RTEMS_INVALID_PRIORITY, 0 },
+ { "invalid date/time", RTEMS_INVALID_CLOCK, 0 },
+ { "invalid node id", RTEMS_INVALID_NODE, 0 },
+ { "directive not configured", RTEMS_NOT_CONFIGURED, 0 },
+ { "not owner of resource", RTEMS_NOT_OWNER_OF_RESOURCE , 0 },
+ { "directive not implemented", RTEMS_NOT_IMPLEMENTED, 0 },
+ { "RTEMS inconsistency detected", RTEMS_INTERNAL_ERROR, 0 },
+ { "could not get enough memory", RTEMS_NO_MEMORY, 0 },
+ { "driver IO error", RTEMS_IO_ERROR, 0 },
+ { "internal multiprocessing only", THREAD_STATUS_PROXY_BLOCKING, 0 },
+ { 0, 0, 0 },
};
-const char *
-rtems_status_text(
- rtems_status_code status
+const char *rtems_status_text(
+ rtems_status_code status
)
{
- return rtems_assoc_name_by_local(rtems_status_assoc, status);
+ return rtems_assoc_name_by_local(rtems_status_assoc, status);
}
static int rtems_verror(
- rtems_error_code_t error_flag,
- const char *printf_format,
- va_list arglist
+ rtems_error_code_t error_flag,
+ const char *printf_format,
+ va_list arglist
)
{
- int local_errno = 0;
- int chars_written = 0;
- rtems_status_code status;
-
- if (error_flag & RTEMS_ERROR_PANIC)
- {
- if (rtems_panic_in_progress++)
- _Thread_Disable_dispatch(); /* disable task switches */
-
- /* don't aggravate things */
- if (rtems_panic_in_progress > 2)
- return 0;
- }
-
- (void) fflush(stdout); /* in case stdout/stderr same */
-
- status = error_flag & ~RTEMS_ERROR_MASK;
- if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
- local_errno = errno;
-
- #if defined(RTEMS_MULTIPROCESSING)
- if (_System_state_Is_multiprocessing)
- fprintf(stderr, "[%" PRIu32 "] ", _Configuration_MP_table->node);
- #endif
-
- chars_written += vfprintf(stderr, printf_format, arglist);
-
- if (status)
- chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status));
-
- if (local_errno)
- {
- if ((local_errno > 0) && *strerror(local_errno))
- chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
- else
- chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
- }
-
- chars_written += fprintf(stderr, "\n");
-
- (void) fflush(stderr);
-
- if (error_flag & (RTEMS_ERROR_PANIC | RTEMS_ERROR_ABORT))
- {
- if (error_flag & RTEMS_ERROR_PANIC)
- {
- rtems_error(0, "fatal error, exiting");
- _exit(local_errno);
- }
- else
- {
- rtems_error(0, "fatal error, aborting");
- abort();
- }
- }
- return chars_written;
+ int local_errno = 0;
+ int chars_written = 0;
+ rtems_status_code status;
+
+ if (error_flag & RTEMS_ERROR_PANIC) {
+ if (rtems_panic_in_progress++)
+ _Thread_Disable_dispatch(); /* disable task switches */
+
+ /* don't aggravate things */
+ if (rtems_panic_in_progress > 2)
+ return 0;
+ }
+
+ (void) fflush(stdout); /* in case stdout/stderr same */
+
+ status = error_flag & ~RTEMS_ERROR_MASK;
+ if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
+ local_errno = errno;
+
+ #if defined(RTEMS_MULTIPROCESSING)
+ if (_System_state_Is_multiprocessing)
+ fprintf(stderr, "[%" PRIu32 "] ", _Configuration_MP_table->node);
+ #endif
+
+ chars_written += vfprintf(stderr, printf_format, arglist);
+
+ if (status)
+ chars_written +=
+ fprintf(stderr, " (status: %s)", rtems_status_text(status));
+
+ if (local_errno) {
+ if ((local_errno > 0) && *strerror(local_errno))
+ chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
+ else
+ chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
+ }
+
+ chars_written += fprintf(stderr, "\n");
+
+ (void) fflush(stderr);
+
+ return chars_written;
}
@@ -175,19 +160,28 @@
*/
int rtems_error(
- rtems_error_code_t error_flag,
- const char *printf_format,
- ...
- )
+ rtems_error_code_t error_flag,
+ const char *printf_format,
+ ...
+)
{
- va_list arglist;
- int chars_written;
+ va_list arglist;
+ int chars_written;
- va_start(arglist, printf_format);
- chars_written = rtems_verror(error_flag, printf_format, arglist);
- va_end(arglist);
+ va_start(arglist, printf_format);
+ chars_written = rtems_verror(error_flag, printf_format, arglist);
+ va_end(arglist);
+
+ if (error_flag & RTEMS_ERROR_PANIC) {
+ rtems_error(0, "fatal error, exiting");
+ _exit(errno);
+ }
+ if (error_flag & RTEMS_ERROR_ABORT) {
+ rtems_error(0, "fatal error, aborting");
+ abort();
+ }
- return chars_written;
+ return chars_written;
}
/*
@@ -195,13 +189,16 @@
*/
void rtems_panic(
- const char *printf_format,
- ...
- )
+ const char *printf_format,
+ ...
+)
{
- va_list arglist;
+ va_list arglist;
+
+ va_start(arglist, printf_format);
+ (void) rtems_verror(RTEMS_ERROR_PANIC, printf_format, arglist);
+ va_end(arglist);
- va_start(arglist, printf_format);
- (void) rtems_verror(RTEMS_ERROR_PANIC, printf_format, arglist);
- va_end(arglist);
+ rtems_error(0, "fatal error, exiting");
+ _exit(errno);
}
*joel*:
2010-06-28 Joel Sherrill <joel.sherrill at oarcorp.com>
* libcsupport/src/__brk.c, libcsupport/src/__gettod.c,
libcsupport/src/__times.c, libcsupport/src/fchdir.c,
libcsupport/src/ftrylockfile.c, libcsupport/src/getpwent.c,
libcsupport/src/gxx_wrappers.c, libcsupport/src/libio_sockets.c,
libcsupport/src/pipe.c: Use rtems_set_errno_and_return_minus_one()
where it was missed before.
M 1.2468 cpukit/ChangeLog
M 1.14 cpukit/libcsupport/src/__brk.c
M 1.24 cpukit/libcsupport/src/__gettod.c
M 1.25 cpukit/libcsupport/src/__times.c
M 1.10 cpukit/libcsupport/src/fchdir.c
M 1.2 cpukit/libcsupport/src/ftrylockfile.c
M 1.14 cpukit/libcsupport/src/getpwent.c
M 1.19 cpukit/libcsupport/src/gxx_wrappers.c
M 1.13 cpukit/libcsupport/src/libio_sockets.c
M 1.6 cpukit/libcsupport/src/pipe.c
diff -u rtems/cpukit/ChangeLog:1.2467 rtems/cpukit/ChangeLog:1.2468
--- rtems/cpukit/ChangeLog:1.2467 Mon Jun 28 17:13:54 2010
+++ rtems/cpukit/ChangeLog Mon Jun 28 17:14:34 2010
@@ -1,5 +1,14 @@
2010-06-28 Joel Sherrill <joel.sherrill at oarcorp.com>
+ * libcsupport/src/__brk.c, libcsupport/src/__gettod.c,
+ libcsupport/src/__times.c, libcsupport/src/fchdir.c,
+ libcsupport/src/ftrylockfile.c, libcsupport/src/getpwent.c,
+ libcsupport/src/gxx_wrappers.c, libcsupport/src/libio_sockets.c,
+ libcsupport/src/pipe.c: Use rtems_set_errno_and_return_minus_one()
+ where it was missed before.
+
+2010-06-28 Joel Sherrill <joel.sherrill at oarcorp.com>
+
* libcsupport/include/rtems/error.h, libcsupport/src/error.c: Clean up
so rtems_panic() can be a noreturn method. This eliminates some
unreachable and thus untestable code.
diff -u rtems/cpukit/libcsupport/src/__brk.c:1.13 rtems/cpukit/libcsupport/src/__brk.c:1.14
--- rtems/cpukit/libcsupport/src/__brk.c:1.13 Tue Sep 29 23:51:56 2009
+++ rtems/cpukit/libcsupport/src/__brk.c Mon Jun 28 17:14:34 2010
@@ -20,12 +20,12 @@
#if defined(RTEMS_NEWLIB) && !defined(HAVE___BRK)
#include <errno.h>
+#include <rtems/seterr.h>
int __brk(
const void *endds __attribute__((unused))
)
{
- errno = EINVAL;
- return -1;
+ rtems_set_errno_and_return_minus_one( EINVAL );
}
#endif
diff -u rtems/cpukit/libcsupport/src/__gettod.c:1.23 rtems/cpukit/libcsupport/src/__gettod.c:1.24
--- rtems/cpukit/libcsupport/src/__gettod.c:1.23 Wed Sep 30 01:45:38 2009
+++ rtems/cpukit/libcsupport/src/__gettod.c Mon Jun 28 17:14:35 2010
@@ -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 @@
)
{
/* 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 );
/*
diff -u rtems/cpukit/libcsupport/src/__times.c:1.24 rtems/cpukit/libcsupport/src/__times.c:1.25
--- rtems/cpukit/libcsupport/src/__times.c:1.24 Wed Dec 2 12:22:18 2009
+++ rtems/cpukit/libcsupport/src/__times.c Mon Jun 28 17:14:35 2010
@@ -22,6 +22,7 @@
#include <sys/time.h>
#include <errno.h>
#include <assert.h>
+#include <rtems/seterr.h>
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
#include <rtems/score/timestamp.h>
#endif
@@ -32,10 +33,8 @@
{
rtems_interval ticks;
- if ( !ptms ) {
- errno = EFAULT;
- return -1;
- }
+ if ( !ptms )
+ rtems_set_errno_and_return_minus_one( EFAULT );
/*
* This call does not depend on TOD being initialized and can't fail.
diff -u rtems/cpukit/libcsupport/src/fchdir.c:1.9 rtems/cpukit/libcsupport/src/fchdir.c:1.10
--- rtems/cpukit/libcsupport/src/fchdir.c:1.9 Thu Jun 11 20:53:32 2009
+++ rtems/cpukit/libcsupport/src/fchdir.c Mon Jun 28 17:14:35 2010
@@ -79,7 +79,7 @@
if (rtems_filesystem_evaluate_path(".", 1, 0, &loc, 0)) {
/* cloning failed; restore original and bail out */
rtems_filesystem_current = saved;
- return -1;
+ return -1;
}
/* release the old one */
rtems_filesystem_freenode( &saved );
diff -u rtems/cpukit/libcsupport/src/ftrylockfile.c:1.1 rtems/cpukit/libcsupport/src/ftrylockfile.c:1.2
--- rtems/cpukit/libcsupport/src/ftrylockfile.c:1.1 Fri Apr 30 23:19:00 2010
+++ rtems/cpukit/libcsupport/src/ftrylockfile.c Mon Jun 28 17:14:35 2010
@@ -13,11 +13,13 @@
#if defined(RTEMS_NEWLIB) && !defined(HAVE_FTRYLOCKFILE) && defined(HAVE_DECL_FTRYLOCKFILE)
#include <stdio.h>
+#include <rtems/seterr.h>
+#include <errno.h>
/* This is a non-functional stub */
int ftrylockfile(FILE* file)
{
- return -1;
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
#endif
diff -u rtems/cpukit/libcsupport/src/getpwent.c:1.13 rtems/cpukit/libcsupport/src/getpwent.c:1.14
--- rtems/cpukit/libcsupport/src/getpwent.c:1.13 Mon Sep 14 23:18:40 2009
+++ rtems/cpukit/libcsupport/src/getpwent.c Mon Jun 28 17:14:35 2010
@@ -24,6 +24,7 @@
#include <ctype.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
/*
* Static, thread-unsafe, buffers
@@ -188,31 +189,28 @@
init_etc_passwd_group();
- if ((fp = fopen("/etc/passwd", "r")) == NULL) {
- errno = EINVAL;
- return -1;
- }
+ if ((fp = fopen("/etc/passwd", "r")) == NULL)
+ rtems_set_errno_and_return_minus_one( EINVAL );
+
for(;;) {
- if (!scanpw(fp, pwd, buffer, bufsize)) {
- errno = EINVAL;
- fclose(fp);
- return -1;
- }
+ if (!scanpw(fp, pwd, buffer, bufsize))
+ goto error_einval;
+
if (name) {
match = (strcmp(pwd->pw_name, name) == 0);
- }
- else {
+ } else {
match = (pwd->pw_uid == uid);
}
+
if (match) {
fclose(fp);
*result = pwd;
return 0;
}
}
+error_einval:
fclose(fp);
- errno = EINVAL;
- return -1;
+ rtems_set_errno_and_return_minus_one( EINVAL );
}
int getpwnam_r(
@@ -347,31 +345,28 @@
init_etc_passwd_group();
- if ((fp = fopen("/etc/group", "r")) == NULL) {
- errno = EINVAL;
- return -1;
- }
+ if ((fp = fopen("/etc/group", "r")) == NULL)
+ rtems_set_errno_and_return_minus_one( EINVAL );
+
for(;;) {
- if (!scangr(fp, grp, buffer, bufsize)) {
- errno = EINVAL;
- fclose(fp);
- return -1;
- }
+ if (!scangr(fp, grp, buffer, bufsize))
+ goto error_einval;
+
if (name) {
match = (strcmp(grp->gr_name, name) == 0);
- }
- else {
+ } else {
match = (grp->gr_gid == gid);
}
+
if (match) {
fclose(fp);
*result = grp;
return 0;
}
}
+error_einval:
fclose(fp);
- errno = EINVAL;
- return -1;
+ rtems_set_errno_and_return_minus_one( EINVAL );
}
int getgrnam_r(
diff -u rtems/cpukit/libcsupport/src/gxx_wrappers.c:1.18 rtems/cpukit/libcsupport/src/gxx_wrappers.c:1.19
--- rtems/cpukit/libcsupport/src/gxx_wrappers.c:1.18 Thu Jan 29 08:32:43 2009
+++ rtems/cpukit/libcsupport/src/gxx_wrappers.c Mon Jun 28 17:14:35 2010
@@ -105,7 +105,7 @@
#endif
/* register with RTEMS the buffer that will hold the key values */
if( rtems_task_variable_add( RTEMS_SELF, (void **)new_key, dtor ) == RTEMS_SUCCESSFUL )
- return 0;
+ return 0;
return -1;
}
diff -u rtems/cpukit/libcsupport/src/libio_sockets.c:1.12 rtems/cpukit/libcsupport/src/libio_sockets.c:1.13
--- rtems/cpukit/libcsupport/src/libio_sockets.c:1.12 Fri Mar 27 08:45:31 2009
+++ rtems/cpukit/libcsupport/src/libio_sockets.c Mon Jun 28 17:14:35 2010
@@ -62,10 +62,9 @@
int fd;
iop = rtems_libio_allocate();
- if (iop == 0) {
- errno = ENFILE;
- return -1;
- }
+ if (iop == 0)
+ rtems_set_errno_and_return_minus_one( ENFILE );
+
fd = iop - rtems_libio_iops;
iop->flags |= LIBIO_FLAGS_WRITE | LIBIO_FLAGS_READ;
iop->data0 = fd;
diff -u rtems/cpukit/libcsupport/src/pipe.c:1.5 rtems/cpukit/libcsupport/src/pipe.c:1.6
--- rtems/cpukit/libcsupport/src/pipe.c:1.5 Tue Oct 14 10:06:25 2008
+++ rtems/cpukit/libcsupport/src/pipe.c Mon Jun 28 17:14:35 2010
@@ -17,6 +17,7 @@
#include <errno.h>
#include <sys/types.h>
+#include <rtems/seterr.h>
extern int pipe_create(int filsdes[2]);
@@ -24,9 +25,8 @@
int filsdes[2]
)
{
- if (filsdes == NULL) {
- errno = EFAULT;
- return -1;
- }
+ if (filsdes == NULL)
+ rtems_set_errno_and_return_minus_one( EFAULT );
+
return pipe_create(filsdes);
}
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100628/1f71a495/attachment-0001.html>
More information about the vc
mailing list