<!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-23)</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>jennifer</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-06-23 Jennifer Averett <Jennifer Averett@OARcorp.com>

        * Makefile.am, configure.ac: Added test case for calls that check for
        an unopened file descriptor.
        * psxfile02/.cvsignore, psxfile02/Makefile.am, psxfile02/init.c,
        psxfile02/psxfile02.doc, psxfile02/psxfile02.scn: New files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/ChangeLog.diff?r1=text&tr1=1.267&r2=text&tr2=1.268&diff_format=h">M</a></td><td width='1%'>1.268</td><td width='100%'>testsuites/psxtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/Makefile.am.diff?r1=text&tr1=1.58&r2=text&tr2=1.59&diff_format=h">M</a></td><td width='1%'>1.59</td><td width='100%'>testsuites/psxtests/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/configure.ac.diff?r1=text&tr1=1.61&r2=text&tr2=1.62&diff_format=h">M</a></td><td width='1%'>1.62</td><td width='100%'>testsuites/psxtests/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxfile02/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxfile02/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxfile02/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxfile02/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxfile02/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxfile02/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxfile02/psxfile02.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxfile02/psxfile02.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxfile02/psxfile02.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxfile02/psxfile02.scn</font></td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtests/ChangeLog:1.267 rtems/testsuites/psxtests/ChangeLog:1.268
--- rtems/testsuites/psxtests/ChangeLog:1.267   Tue Jun 22 12:44:01 2010
+++ rtems/testsuites/psxtests/ChangeLog Wed Jun 23 13:43:23 2010
</font><font color='#997700'>@@ -1,3 +1,10 @@
</font><font color='#000088'>+2010-06-23    Jennifer Averett <Jennifer Averett@OARcorp.com>
+
+       * Makefile.am, configure.ac: Added test case for calls that check for
+       an unopened file descriptor.
+       * psxfile02/.cvsignore, psxfile02/Makefile.am, psxfile02/init.c,
+       psxfile02/psxfile02.doc, psxfile02/psxfile02.scn: New files.
+
</font> 2010-06-22        Jennifer Averett <Jennifer.Averett@OARcorp.com>
 
        * psxtime/psxtime.scn, psxtime/test.c: Add a normal case with second

<font color='#006600'>diff -u rtems/testsuites/psxtests/Makefile.am:1.58 rtems/testsuites/psxtests/Makefile.am:1.59
--- rtems/testsuites/psxtests/Makefile.am:1.58  Mon Dec 28 10:43:10 2009
+++ rtems/testsuites/psxtests/Makefile.am       Wed Jun 23 13:43:23 2010
</font><font color='#997700'>@@ -19,8 +19,8 @@
</font> endif
 
 ## File IO tests
<font color='#880000'>-SUBDIRS += psxfile01 psxreaddir psxstat psxmount psx13 psxchroot01 \
-  psxpasswd01
</font><font color='#000088'>+SUBDIRS += psxfile01 psxfile02 psxreaddir psxstat psxmount psx13 \
+  psxchroot01 psxpasswd01
</font> 
 ## Until sys/uio.h is moved to libcsupport, we have to have networking
 ## enabled to support readv and writev.  Hopefully this is a temporary

<font color='#006600'>diff -u rtems/testsuites/psxtests/configure.ac:1.61 rtems/testsuites/psxtests/configure.ac:1.62
--- rtems/testsuites/psxtests/configure.ac:1.61 Sat May 29 00:31:45 2010
+++ rtems/testsuites/psxtests/configure.ac      Wed Jun 23 13:43:23 2010
</font><font color='#997700'>@@ -87,6 +87,7 @@
</font> psxfatal01/Makefile
 psxfatal02/Makefile
 psxfile01/Makefile
<font color='#000088'>+psxfile02/Makefile
</font> psxhdrs/Makefile
 psxintrcritical01/Makefile
 psxitimer/Makefile

<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxfile02/.cvsignore:1.1
--- /dev/null   Wed Jun 23 14:13:23 2010
+++ rtems/testsuites/psxtests/psxfile02/.cvsignore      Wed Jun 23 13:43:23 2010
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxfile02/Makefile.am:1.1
--- /dev/null   Wed Jun 23 14:13:24 2010
+++ rtems/testsuites/psxtests/psxfile02/Makefile.am     Wed Jun 23 13:43:23 2010
</font><font color='#997700'>@@ -0,0 +1,26 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxfile02
+psxfile02_SOURCES = init.c ../../support/src/spin.c
+
+dist_rtems_tests_DATA = psxfile02.scn
+dist_rtems_tests_DATA += psxfile02.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxfile02_OBJECTS) $(psxfile02_LDADD)
+LINK_LIBS = $(psxfile02_LDLIBS)
+
+psxfile02$(EXEEXT): $(psxfile02_OBJECTS) $(psxfile02_DEPENDENCIES)
+       @rm -f psxfile02$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxfile02/init.c:1.1
--- /dev/null   Wed Jun 23 14:13:24 2010
+++ rtems/testsuites/psxtests/psxfile02/init.c  Wed Jun 23 13:43:24 2010
</font><font color='#997700'>@@ -0,0 +1,152 @@
</font><font color='#000088'>+/*
+ *  COPYRIGHT (c) 1989-2010.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+#include <stdio.h>
+#include <sys/uio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <ctype.h>
+#include <rtems/imfs.h>
+
+#include <rtems.h>
+#include <rtems/libio.h>
+
+#include <tmacros.h>
+#include "test_support.h"
+
+int _fcntl_r(
+  struct _reent *ptr __attribute__((unused)),
+  int fd,
+  int cmd,
+  int arg
+);
+
+off_t _lseek_r(
+  struct _reent *ptr __attribute__((unused)),
+  int            fd,
+  off_t          offset,
+  int            whence
+);
+
+
+
+rtems_task Init(
+  rtems_task_argument argument
+)
+{
+  int               fd;
+  struct stat       stat_buff;
+  struct iovec      vec[4];
+  off_t             res;
+  int               status;
+
+  puts( "\n\n*** PSXFILE02 TEST  ***" );
+
+  /*
+   *  Simple open case where the file is created.
+   */
+  puts( "mkdir /tmp" );
+  status = mkdir( "/tmp", S_IRWXU );
+  rtems_test_assert( !status );
+
+  puts( "open /tmp/j" );
+  fd = open( "/tmp/j", O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO );
+  rtems_test_assert( fd != -1 );
+  printf( "open returned file descriptor %d\n", fd );
+
+  puts( "close /tmp/j" );
+  status = close( fd );
+  rtems_test_assert( !status );
+
+  puts("ftruncate an unopened file");
+  status = ftruncate(fd, 40);
+  rtems_test_assert( status == -1 );
+  printf( "%d: %s\n", errno, strerror( errno ) );
+  rtems_test_assert( errno == EBADF );
+
+  puts("_fcntl_r unopened file");
+  status = _fcntl_r( NULL, fd, F_SETFD, 1 );
+  rtems_test_assert( status == -1 );
+  printf( "%d: %s\n", errno, strerror( errno ) );
+  rtems_test_assert( errno == EBADF );
+
+  puts("fdatasync unopened file");
+  status = fdatasync( fd );
+  rtems_test_assert( status == -1 );
+  printf( "%d: %s\n", errno, strerror( errno ) );
+  rtems_test_assert( errno == EBADF );
+
+  puts("fstat unopened file");
+  status = fstat( fd, &stat_buff );
+  rtems_test_assert( status == -1 );
+  printf( "%d: %s\n", errno, strerror( errno ) );
+  rtems_test_assert( errno == EBADF );
+
+  puts("fsync unopened file");
+  status = fsync( fd );
+  rtems_test_assert( status == -1 );
+  printf( "%d: %s\n", errno, strerror( errno ) );
+  rtems_test_assert( errno == EBADF );
+
+  puts("ioctl unopened file");
+  status = ioctl( fd, 0 );
+  rtems_test_assert( status == -1 );
+  printf( "%d: %s\n", errno, strerror( errno ) );
+  rtems_test_assert( errno == EBADF );
+
+  puts("_lseek_r unopened file");
+  res = _lseek_r (NULL, fd, 0, SEEK_SET);
+  rtems_test_assert( res == -1 );
+  printf( "%d: %s\n", errno, strerror( errno ) );
+  rtems_test_assert( errno == EBADF );
+
+  puts("readv unopened file");
+  status = readv(fd, vec, 4);
+  rtems_test_assert( status == -1 );
+  printf( "%d: %s\n", errno, strerror( errno ) );
+  rtems_test_assert( errno == EBADF );
+
+  puts("writev unopened file");
+  status = writev(fd, vec, 4);
+  rtems_test_assert( status == -1 );
+  printf( "%d: %s\n", errno, strerror( errno ) );
+  rtems_test_assert( errno == EBADF );
+
+  puts("write unopened file");
+  status = write(fd, "1234", 4);
+  rtems_test_assert( status == -1 );
+  printf( "%d: %s\n", errno, strerror( errno ) );
+  rtems_test_assert( errno == EBADF );
+
+
+
+
+  puts( "*** END OF PSXFILE02 TEST  ***" );
+
+  rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 6
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxfile02/psxfile02.doc:1.1
--- /dev/null   Wed Jun 23 14:13:24 2010
+++ rtems/testsuites/psxtests/psxfile02/psxfile02.doc   Wed Jun 23 13:43:24 2010
</font><font color='#997700'>@@ -0,0 +1,22 @@
</font><font color='#000088'>+#
+#  $Id$
+#
+#  COPYRIGHT (c) 1989-2010.
+#  On-Line Applications Research Corporation (OAR).
+#
+#  The license and distribution terms for this file may be
+#  found in the file LICENSE in this distribution or at
+#  http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name:  psxfile02
+
+directives:
+
+  XXX list them
+
+concepts:
+
++ XXX list them
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxfile02/psxfile02.scn:1.1
--- /dev/null   Wed Jun 23 14:13:24 2010
+++ rtems/testsuites/psxtests/psxfile02/psxfile02.scn   Wed Jun 23 13:43:24 2010
</font><font color='#997700'>@@ -0,0 +1,26 @@
</font><font color='#000088'>+*** PSXFILE02 TEST  ***
+mkdir /tmp
+open /tmp/j
+open returned file descriptor 3
+close /tmp/j
+ftruncate an unopened file
+9: Bad file number
+_fcntl_r unopened file
+9: Bad file number
+fdatasync unopened file
+9: Bad file number
+fstat unopened file
+9: Bad file number
+fsync unopened file
+9: Bad file number
+ioctl unopened file
+9: Bad file number
+_lseek_r unopened file
+9: Bad file number
+readv unopened file
+9: Bad file number
+writev unopened file
+9: Bad file number
+write unopened file
+9: Bad file number
+*** END OF PSXFILE02 TEST  ***
</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-23 Joel Sherrill <joel.sherrilL@OARcorp.com>

        * libmisc/stackchk/check.c: Clean up to improve coverage.
</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.2453&r2=text&tr2=1.2454&diff_format=h">M</a></td><td width='1%'>1.2454</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libmisc/stackchk/check.c.diff?r1=text&tr1=1.66&r2=text&tr2=1.67&diff_format=h">M</a></td><td width='1%'>1.67</td><td width='100%'>cpukit/libmisc/stackchk/check.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2453 rtems/cpukit/ChangeLog:1.2454
--- rtems/cpukit/ChangeLog:1.2453       Wed Jun 23 00:01:46 2010
+++ rtems/cpukit/ChangeLog      Wed Jun 23 13:18:41 2010
</font><font color='#997700'>@@ -1,3 +1,7 @@
</font><font color='#000088'>+2010-06-23    Joel Sherrill <joel.sherrilL@OARcorp.com>
+
+       * libmisc/stackchk/check.c: Clean up to improve coverage.
+
</font> 2010-06-23        Chris Johns <chrisj@rtems.org>
 
        PR 1577/filesystem

<font color='#006600'>diff -u rtems/cpukit/libmisc/stackchk/check.c:1.66 rtems/cpukit/libmisc/stackchk/check.c:1.67
--- rtems/cpukit/libmisc/stackchk/check.c:1.66  Sat Apr 10 02:32:13 2010
+++ rtems/cpukit/libmisc/stackchk/check.c       Wed Jun 23 13:18:42 2010
</font><font color='#997700'>@@ -116,12 +116,13 @@
</font> #define Stack_check_usable_stack_size(_the_stack) \
     ((_the_stack)->size - sizeof(Stack_check_Control))
 
<font color='#880000'>-/*
- * Do we have an interrupt stack?
- * XXX it would sure be nice if the interrupt stack were also
- *     stored in a "stack" structure!
- */
-Stack_Control Stack_check_Interrupt_stack;
</font><font color='#000088'>+#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
+  /*
+   *  Did RTEMS allocate the interrupt stack? If so, put it in
+   *  Stack_Control format.
+   */
+  Stack_Control Stack_check_Interrupt_stack;
+#endif
</font> 
 /*
  *  Fill an entire stack area with BYTE_PATTERN.  This will be used
<font color='#997700'>@@ -381,28 +382,28 @@
</font>   Stack_Control  *stack;
   char            name[5];
 
<font color='#880000'>-  if ( !the_thread )
-    return;
-
-  if ( !print_handler )
-    return;
</font><font color='#000088'>+  /*
+   *  The pointer passed in for the_thread is guaranteed to be non-NULL from
+   *  rtems_iterate_over_all_threads() so no need to check it here.
+   */
</font> 
   /*
    *  Obtain interrupt stack information
    */
<font color='#880000'>-
-  if (the_thread == (Thread_Control *) -1) {
-    if (Stack_check_Interrupt_stack.area) {
</font><font color='#000088'>+  #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
+    if (the_thread == (Thread_Control *) -1) {
+      if (!Stack_check_Interrupt_stack.area)
+        return;
</font>       stack = &Stack_check_Interrupt_stack;
       the_thread = 0;
       current = 0;
<font color='#000088'>+    } else<span style="background-color: #FF0000"> </span>
+  #else
+    {
+      stack  = &the_thread->Start.Initial_stack;
+      current = (void *)_CPU_Context_Get_SP( &the_thread->Registers );
</font>     }
<font color='#880000'>-    else
-      return;
-  } else {
-    stack  = &the_thread->Start.Initial_stack;
-    current = (void *)_CPU_Context_Get_SP( &the_thread->Registers );
-  }
</font><font color='#000088'>+  #endif
</font> 
   low  = Stack_check_usable_stack_start(stack);
   size = Stack_check_usable_stack_size(stack);
<font color='#997700'>@@ -468,6 +469,9 @@
</font>   rtems_printk_plugin_t  print
 )
 {
<font color='#000088'>+  if ( !print )
+    return;
+
</font>   print_context = context;
   print_handler = print;
 
<font color='#997700'>@@ -479,8 +483,10 @@
</font>   /* iterate over all threads and dump the usage */
   rtems_iterate_over_all_threads( Stack_check_Dump_threads_usage );
 
<font color='#880000'>-  /* dump interrupt stack info if any */
-  Stack_check_Dump_threads_usage((Thread_Control *) -1);
</font><font color='#000088'>+  #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
+    /* dump interrupt stack info if any */
+    Stack_check_Dump_threads_usage((Thread_Control *) -1);
+  #endif
</font> 
   print_context = NULL;
   print_handler = NULL;
</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>