<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2010-06-28)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-06-28 Joel Sherrill <joel.sherrill@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.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2466&r2=text&tr2=1.2467&diff_format=h">M</a></td><td width='1%'>1.2467</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/include/rtems/error.h.diff?r1=text&tr1=1.10&r2=text&tr2=1.11&diff_format=h">M</a></td><td width='1%'>1.11</td><td width='100%'>cpukit/libcsupport/include/rtems/error.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/error.c.diff?r1=text&tr1=1.22&r2=text&tr2=1.23&diff_format=h">M</a></td><td width='1%'>1.23</td><td width='100%'>cpukit/libcsupport/src/error.c</td></tr>
</table>
<pre>
<font color='#006600'>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
</font><font color='#997700'>@@ -1,3 +1,9 @@
</font><font color='#000088'>+2010-06-28    Joel Sherrill <joel.sherrill@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.
+
</font> 2010-06-28        Joel Sherrill <joel.sherrilL@OARcorp.com>
 
        * libcsupport/src/termios.c: Formatting.

<font color='#006600'>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
</font><font color='#997700'>@@ -34,22 +34,19 @@
</font> #define RTEMS_ERROR_ABORT  (0x10000000) /* err is fatal; panic */
 #endif
 
<font color='#880000'>-#define RTEMS_ERROR_MASK  (RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | \
-                             RTEMS_ERROR_PANIC) /* all */
</font><font color='#000088'>+#define RTEMS_ERROR_MASK \
+  (RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | RTEMS_ERROR_PANIC) /* all */
</font> 
 const char *rtems_status_text(rtems_status_code);
<font color='#880000'>-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
</font><font color='#000088'>+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;
</font> 
 extern int rtems_panic_in_progress;
 

<font color='#006600'>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
</font><font color='#997700'>@@ -16,17 +16,17 @@
</font>  *
  * error_flag can be specified as any of the following:
  *
<font color='#880000'>- *<span style="background-color: #FF0000">  </span>  RTEMS_ERROR_ERRNO       -- include errno text in output
- *<span style="background-color: #FF0000">  </span>      RTEMS_ERROR_PANIC       -- halts local system after output
- *<span style="background-color: #FF0000">  </span>      RTEMS_ERROR_ABORT       -- abort after output
</font><font color='#000088'>+ *  RTEMS_ERROR_ERRNO       -- include errno text in output
+ *  RTEMS_ERROR_PANIC       -- halts local system after output
+ *  RTEMS_ERROR_ABORT       -- abort after output
</font>  *
  * It can also include a rtems_status value which can be OR'd
  * with the above flags. *
  *
  * EXAMPLE
<font color='#880000'>- * #include <rtems.h>
- *     #include <rtems/error.h>
- *     rtems_error(0, "stray interrupt %d", intr);
</font><font color='#000088'>+ *  #include <rtems.h>
+ *  #include <rtems/error.h>
+ *  rtems_error(0, "stray interrupt %d", intr);
</font>  *
  * EXAMPLE
  *        if ((status = rtems_task_create(...)) != RTEMS_SUCCCESSFUL)
<font color='#997700'>@@ -54,115 +54,100 @@
</font> #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
<font color='#880000'>-#include <unistd.h>          /* _exit() */
</font><font color='#000088'>+#include <unistd.h>     /* _exit() */
</font> 
 int          rtems_panic_in_progress;
 
 const rtems_assoc_t rtems_status_assoc[] = {
<font color='#880000'>-    { "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 },
</font><font color='#000088'>+  { "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 },
</font> };
 
 
<font color='#880000'>-const char *
-rtems_status_text(
-    rtems_status_code status
</font><font color='#000088'>+const char *rtems_status_text(
+  rtems_status_code status
</font> )
 {
<font color='#880000'>-    return rtems_assoc_name_by_local(rtems_status_assoc, status);
</font><font color='#000088'>+  return rtems_assoc_name_by_local(rtems_status_assoc, status);
</font> }
 
 
 static int rtems_verror(
<font color='#880000'>-    rtems_error_code_t error_flag,
-    const char   *printf_format,
-    va_list      arglist
</font><font color='#000088'>+  rtems_error_code_t  error_flag,
+  const char         *printf_format,
+  va_list             arglist
</font> )
 {
<font color='#880000'>-    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);<span style="background-color: #FF0000">  </span>          /* 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;
</font><font color='#000088'>+  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;
</font> }
 
 
<font color='#997700'>@@ -175,19 +160,28 @@
</font>  */
 
 int rtems_error(
<font color='#880000'>-    rtems_error_code_t error_flag,
-    const char *printf_format,
-    ...
-  )
</font><font color='#000088'>+  rtems_error_code_t error_flag,
+  const char *printf_format,
+  ...
+)
</font> {
<font color='#880000'>-    va_list arglist;
-    int chars_written;
</font><font color='#000088'>+  va_list arglist;
+  int chars_written;
</font> 
<font color='#880000'>-    va_start(arglist, printf_format);
-    chars_written = rtems_verror(error_flag, printf_format, arglist);
-    va_end(arglist);
</font><font color='#000088'>+  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();
+  }
</font> 
<font color='#880000'>-    return chars_written;
</font><font color='#000088'>+  return chars_written;
</font> }
 
 /*
<font color='#997700'>@@ -195,13 +189,16 @@
</font>  */
 
 void rtems_panic(
<font color='#880000'>-    const char *printf_format,
-    ...
-  )
</font><font color='#000088'>+  const char *printf_format,
+  ...
+)
</font> {
<font color='#880000'>-    va_list arglist;
</font><font color='#000088'>+  va_list arglist;
+
+  va_start(arglist, printf_format);
+  (void) rtems_verror(RTEMS_ERROR_PANIC, printf_format, arglist);
+  va_end(arglist);
</font> 
<font color='#880000'>-    va_start(arglist, printf_format);
-    (void) rtems_verror(RTEMS_ERROR_PANIC, printf_format, arglist);
-    va_end(arglist);
</font><font color='#000088'>+  rtems_error(0, "fatal error, exiting");
+  _exit(errno);
</font> }
</pre>
<p> </p>
<a name='cs2'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-06-28 Joel Sherrill <joel.sherrill@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.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2467&r2=text&tr2=1.2468&diff_format=h">M</a></td><td width='1%'>1.2468</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/__brk.c.diff?r1=text&tr1=1.13&r2=text&tr2=1.14&diff_format=h">M</a></td><td width='1%'>1.14</td><td width='100%'>cpukit/libcsupport/src/__brk.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/__gettod.c.diff?r1=text&tr1=1.23&r2=text&tr2=1.24&diff_format=h">M</a></td><td width='1%'>1.24</td><td width='100%'>cpukit/libcsupport/src/__gettod.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/__times.c.diff?r1=text&tr1=1.24&r2=text&tr2=1.25&diff_format=h">M</a></td><td width='1%'>1.25</td><td width='100%'>cpukit/libcsupport/src/__times.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/fchdir.c.diff?r1=text&tr1=1.9&r2=text&tr2=1.10&diff_format=h">M</a></td><td width='1%'>1.10</td><td width='100%'>cpukit/libcsupport/src/fchdir.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/ftrylockfile.c.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>cpukit/libcsupport/src/ftrylockfile.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/getpwent.c.diff?r1=text&tr1=1.13&r2=text&tr2=1.14&diff_format=h">M</a></td><td width='1%'>1.14</td><td width='100%'>cpukit/libcsupport/src/getpwent.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/gxx_wrappers.c.diff?r1=text&tr1=1.18&r2=text&tr2=1.19&diff_format=h">M</a></td><td width='1%'>1.19</td><td width='100%'>cpukit/libcsupport/src/gxx_wrappers.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/libio_sockets.c.diff?r1=text&tr1=1.12&r2=text&tr2=1.13&diff_format=h">M</a></td><td width='1%'>1.13</td><td width='100%'>cpukit/libcsupport/src/libio_sockets.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/pipe.c.diff?r1=text&tr1=1.5&r2=text&tr2=1.6&diff_format=h">M</a></td><td width='1%'>1.6</td><td width='100%'>cpukit/libcsupport/src/pipe.c</td></tr>
</table>
<pre>
<font color='#006600'>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
</font><font color='#997700'>@@ -1,5 +1,14 @@
</font> 2010-06-28        Joel Sherrill <joel.sherrill@oarcorp.com>
 
<font color='#000088'>+   * 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@oarcorp.com>
+
</font>   * 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.

<font color='#006600'>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
</font><font color='#997700'>@@ -20,12 +20,12 @@
</font> #if defined(RTEMS_NEWLIB) && !defined(HAVE___BRK)
 
 #include <errno.h>
<font color='#000088'>+#include <rtems/seterr.h>
</font> 
 int __brk(
   const void *endds __attribute__((unused))
 )
 {
<font color='#880000'>-  errno = EINVAL;
-  return -1;
</font><font color='#000088'>+  rtems_set_errno_and_return_minus_one( EINVAL );
</font> }
 #endif

<font color='#006600'>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
</font><font color='#997700'>@@ -21,6 +21,7 @@
</font> #include <sys/time.h>
 #include <errno.h>
 #include <rtems.h>
<font color='#000088'>+#include <rtems/seterr.h>
</font> 
 #if defined(RTEMS_NEWLIB) && !defined(HAVE_GETTIMEOFDAY)
 /*
<font color='#997700'>@@ -32,16 +33,13 @@
</font> )
 {
   /* struct timezone* tzp = (struct timezone*) __tz; */
<font color='#880000'>-  if ( !tp ) {
-    errno = EFAULT;
-    return -1;
-  }
</font><font color='#000088'>+  if ( !tp )
+    rtems_set_errno_and_return_minus_one( EFAULT );
</font> 
   /*
    *  POSIX does not seem to allow for not having a TOD so we just
    *  grab the time of day.
    */
<font color='#880000'>-
</font>   _TOD_Get_timeval( tp );
 
   /*

<font color='#006600'>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
</font><font color='#997700'>@@ -22,6 +22,7 @@
</font> #include <sys/time.h>
 #include <errno.h>
 #include <assert.h>
<font color='#000088'>+#include <rtems/seterr.h>
</font> #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
   #include <rtems/score/timestamp.h>
 #endif
<font color='#997700'>@@ -32,10 +33,8 @@
</font> {
   rtems_interval ticks;
 
<font color='#880000'>-  if ( !ptms ) {
-    errno = EFAULT;
-    return -1;
-  }
</font><font color='#000088'>+  if ( !ptms )
+    rtems_set_errno_and_return_minus_one( EFAULT );
</font> 
   /*
    *  This call does not depend on TOD being initialized and can't fail.

<font color='#006600'>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
</font><font color='#997700'>@@ -79,7 +79,7 @@
</font>   if (rtems_filesystem_evaluate_path(".", 1, 0, &loc, 0)) {
     /* cloning failed; restore original and bail out */
     rtems_filesystem_current = saved;
<font color='#880000'>-   return -1;
</font><font color='#000088'>+    return -1;
</font>   }
   /* release the old one */
   rtems_filesystem_freenode( &saved );

<font color='#006600'>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
</font><font color='#997700'>@@ -13,11 +13,13 @@
</font> #if defined(RTEMS_NEWLIB) && !defined(HAVE_FTRYLOCKFILE) && defined(HAVE_DECL_FTRYLOCKFILE)
 
 #include <stdio.h>
<font color='#000088'>+#include <rtems/seterr.h>
+#include <errno.h>
</font> 
 /* This is a non-functional stub */
 int ftrylockfile(FILE* file)
 {
<font color='#880000'>-  return -1;
</font><font color='#000088'>+  rtems_set_errno_and_return_minus_one( ENOTSUP );
</font> }
 
 #endif

<font color='#006600'>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
</font><font color='#997700'>@@ -24,6 +24,7 @@
</font> #include <ctype.h>
 
 #include <rtems/libio_.h>
<font color='#000088'>+#include <rtems/seterr.h>
</font> 
 /*
  * Static, thread-unsafe, buffers
<font color='#997700'>@@ -188,31 +189,28 @@
</font> 
   init_etc_passwd_group();
 
<font color='#880000'>-  if ((fp = fopen("/etc/passwd", "r")) == NULL) {
-    errno = EINVAL;
-    return -1;
-  }
</font><font color='#000088'>+  if ((fp = fopen("/etc/passwd", "r")) == NULL)
+    rtems_set_errno_and_return_minus_one( EINVAL );
+
</font>   for(;;) {
<font color='#880000'>-    if (!scanpw(fp, pwd, buffer, bufsize)) {
-      errno = EINVAL;
-      fclose(fp);
-      return -1;
-    }
</font><font color='#000088'>+    if (!scanpw(fp, pwd, buffer, bufsize))
+      goto error_einval;
+
</font>     if (name) {
       match = (strcmp(pwd->pw_name, name) == 0);
<font color='#880000'>-    }
-    else {
</font><font color='#000088'>+    } else {
</font>       match = (pwd->pw_uid == uid);
     }
<font color='#000088'>+
</font>     if (match) {
       fclose(fp);
       *result = pwd;
       return 0;
     }
   }
<font color='#000088'>+error_einval:
</font>   fclose(fp);
<font color='#880000'>-  errno = EINVAL;
-  return -1;
</font><font color='#000088'>+  rtems_set_errno_and_return_minus_one( EINVAL );
</font> }
 
 int getpwnam_r(
<font color='#997700'>@@ -347,31 +345,28 @@
</font> 
   init_etc_passwd_group();
 
<font color='#880000'>-  if ((fp = fopen("/etc/group", "r")) == NULL) {
-    errno = EINVAL;
-    return -1;
-  }
</font><font color='#000088'>+  if ((fp = fopen("/etc/group", "r")) == NULL)
+    rtems_set_errno_and_return_minus_one( EINVAL );
+
</font>   for(;;) {
<font color='#880000'>-    if (!scangr(fp, grp, buffer, bufsize)) {
-      errno = EINVAL;
-      fclose(fp);
-      return -1;
-    }
</font><font color='#000088'>+    if (!scangr(fp, grp, buffer, bufsize))
+      goto error_einval;
+
</font>     if (name) {
       match = (strcmp(grp->gr_name, name) == 0);
<font color='#880000'>-    }
-    else {
</font><font color='#000088'>+    } else {
</font>       match = (grp->gr_gid == gid);
     }
<font color='#000088'>+
</font>     if (match) {
       fclose(fp);
       *result = grp;
       return 0;
     }
   }
<font color='#000088'>+error_einval:
</font>   fclose(fp);
<font color='#880000'>-  errno = EINVAL;
-  return -1;
</font><font color='#000088'>+  rtems_set_errno_and_return_minus_one( EINVAL );
</font> }
 
 int getgrnam_r(

<font color='#006600'>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
</font><font color='#997700'>@@ -105,7 +105,7 @@
</font> #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 )
<font color='#880000'>-       return 0;
</font><font color='#000088'>+    return 0;
</font>   return -1;
 }
 

<font color='#006600'>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
</font><font color='#997700'>@@ -62,10 +62,9 @@
</font>   int fd;
 
   iop = rtems_libio_allocate();
<font color='#880000'>-  if (iop == 0) {
-      errno = ENFILE;
-      return -1;
-  }
</font><font color='#000088'>+  if (iop == 0)
+      rtems_set_errno_and_return_minus_one( ENFILE );
+
</font>   fd = iop - rtems_libio_iops;
   iop->flags |= LIBIO_FLAGS_WRITE | LIBIO_FLAGS_READ;
   iop->data0 = fd;

<font color='#006600'>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
</font><font color='#997700'>@@ -17,6 +17,7 @@
</font> 
 #include <errno.h>
 #include <sys/types.h>
<font color='#000088'>+#include <rtems/seterr.h>
</font> 
 extern int pipe_create(int filsdes[2]);
 
<font color='#997700'>@@ -24,9 +25,8 @@
</font>   int filsdes[2]
 )
 {
<font color='#880000'>-  if (filsdes == NULL) {
-    errno = EFAULT;
-    return -1;
-  }
</font><font color='#000088'>+  if (filsdes == NULL)
+    rtems_set_errno_and_return_minus_one( EFAULT );
+
</font>   return pipe_create(filsdes);
 }
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>