<!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-07-05)</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-07-05 Joel Sherrill <joel.sherrill@oarcorp.com>

        * Makefile.am, configure.ac, malloc03/init.c: Add test for PPPDDISC.
        * termios06/.cvsignore, termios06/Makefile.am, termios06/init.c,
        termios06/termios06.doc, termios06/termios06.scn,
        termios06/test_pppd.c: New files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/ChangeLog.diff?r1=text&tr1=1.196&r2=text&tr2=1.197&diff_format=h">M</a></td><td width='1%'>1.197</td><td width='100%'>testsuites/libtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/Makefile.am.diff?r1=text&tr1=1.34&r2=text&tr2=1.35&diff_format=h">M</a></td><td width='1%'>1.35</td><td width='100%'>testsuites/libtests/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/configure.ac.diff?r1=text&tr1=1.41&r2=text&tr2=1.42&diff_format=h">M</a></td><td width='1%'>1.42</td><td width='100%'>testsuites/libtests/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/malloc03/init.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%'>testsuites/libtests/malloc03/init.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/termios06/.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/libtests/termios06/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/termios06/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/libtests/termios06/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/termios06/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/libtests/termios06/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/termios06/termios06.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/libtests/termios06/termios06.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/termios06/termios06.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/libtests/termios06/termios06.scn</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/termios06/test_pppd.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/libtests/termios06/test_pppd.c</font></td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/libtests/ChangeLog:1.196 rtems/testsuites/libtests/ChangeLog:1.197
--- rtems/testsuites/libtests/ChangeLog:1.196   Thu Jul  1 09:37:35 2010
+++ rtems/testsuites/libtests/ChangeLog Mon Jul  5 16:14:39 2010
</font><font color='#997700'>@@ -1,3 +1,10 @@
</font><font color='#000088'>+2010-07-05    Joel Sherrill <joel.sherrill@oarcorp.com>
+
+       * Makefile.am, configure.ac, malloc03/init.c: Add test for PPPDDISC.
+       * termios06/.cvsignore, termios06/Makefile.am, termios06/init.c,
+       termios06/termios06.doc, termios06/termios06.scn,
+       termios06/test_pppd.c: New files.
+
</font> 2010-07-01        Joel Sherrill <joel.sherrill@oarcorp.com>
 
        * Makefile.am, configure.ac: Add test for GCC C++ library helpers.

<font color='#006600'>diff -u rtems/testsuites/libtests/Makefile.am:1.34 rtems/testsuites/libtests/Makefile.am:1.35
--- rtems/testsuites/libtests/Makefile.am:1.34  Thu Jul  1 09:37:36 2010
+++ rtems/testsuites/libtests/Makefile.am       Mon Jul  5 16:14:39 2010
</font><font color='#997700'>@@ -7,8 +7,8 @@
</font> SUBDIRS = POSIX
 
 SUBDIRS += bspcmdline01 cpuuse gxx01 malloctest malloc02 malloc03 heapwalk \
<font color='#880000'>-    putenvtest monitor monitor02 rtmonuse stackchk stackchk01 \
-    termios termios01 termios02 termios03 termios04 termios05 \
</font><font color='#000088'>+    putenvtest monitor monitor02 rtmonuse stackchk stackchk01 tar01 tar02 \
+    termios termios01 termios02 termios03 termios04 termios05 termios06 \
</font>     rtems++ tztest block01 block02 block03 block04 block05 block06 block07 \
     block08 block09 block10 stringto01
 

<font color='#006600'>diff -u rtems/testsuites/libtests/configure.ac:1.41 rtems/testsuites/libtests/configure.ac:1.42
--- rtems/testsuites/libtests/configure.ac:1.41 Thu Jul  1 09:37:37 2010
+++ rtems/testsuites/libtests/configure.ac      Mon Jul  5 16:14:39 2010
</font><font color='#997700'>@@ -58,12 +58,15 @@
</font> stackchk/Makefile
 stackchk01/Makefile
 stringto01/Makefile
<font color='#000088'>+tar01/Makefile
+tar02/Makefile
</font> termios/Makefile
 termios01/Makefile
 termios02/Makefile
 termios03/Makefile
 termios04/Makefile
 termios05/Makefile
<font color='#000088'>+termios06/Makefile
</font> tztest/Makefile
 POSIX/Makefile
 ])

<font color='#006600'>diff -u rtems/testsuites/libtests/malloc03/init.c:1.1 rtems/testsuites/libtests/malloc03/init.c:1.2
--- rtems/testsuites/libtests/malloc03/init.c:1.1       Tue Jun 22 14:27:12 2010
+++ rtems/testsuites/libtests/malloc03/init.c   Mon Jul  5 16:14:39 2010
</font><font color='#997700'>@@ -17,11 +17,10 @@
</font> )
 {
   void *p1;
<font color='#880000'>-  unsigned int val = 999;
</font> 
   puts( "\n\n*** TEST MALLOC03 ***" );
 
<font color='#880000'>-  p1 = &val;
</font><font color='#000088'>+  p1 = __builtin_frame_address(0);
</font>   printf("Attempt to free stack memory\n");
   free( p1 );
 

<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/termios06/.cvsignore:1.1
--- /dev/null   Mon Jul  5 17:13:36 2010
+++ rtems/testsuites/libtests/termios06/.cvsignore      Mon Jul  5 16:14:39 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/libtests/termios06/Makefile.am:1.1
--- /dev/null   Mon Jul  5 17:13:36 2010
+++ rtems/testsuites/libtests/termios06/Makefile.am     Mon Jul  5 16:14:39 2010
</font><font color='#997700'>@@ -0,0 +1,27 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = termios06
+termios06_SOURCES = init.c ../termios03/termios_testdriver_polled.c test_pppd.c
+
+dist_rtems_tests_DATA = termios06.scn
+dist_rtems_tests_DATA += termios06.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
+AM_CPPFLAGS += -I$(top_srcdir)/termios03
+
+LINK_OBJS = $(termios06_OBJECTS) $(termios06_LDADD)
+LINK_LIBS = $(termios06_LDLIBS)
+
+termios06$(EXEEXT): $(termios06_OBJECTS) $(termios06_DEPENDENCIES)
+       @rm -f termios06$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/termios06/init.c:1.1
--- /dev/null   Mon Jul  5 17:13:37 2010
+++ rtems/testsuites/libtests/termios06/init.c  Mon Jul  5 16:14:39 2010
</font><font color='#997700'>@@ -0,0 +1,144 @@
</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 <tmacros.h>
+#include "test_support.h"
+#include "termios_testdriver_polled.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <rtems/dumpbuf.h>
+
+void pppasyncattach(void);
+void ppp_test_driver_set_rx( const char *expected, size_t len );
+
+int Test_fd;
+int InitialDiscipline;
+
+void open_it(void)
+{
+  /* open the file */
+  puts( "open(" TERMIOS_TEST_DRIVER_DEVICE_NAME ") - OK " );
+  Test_fd = open( TERMIOS_TEST_DRIVER_DEVICE_NAME, O_RDWR );
+  rtems_test_assert( Test_fd != -1 );
+}
+
+void set_discipline(void)
+{
+  int pppdisc = PPPDISC;
+  int sc;
+
+  puts( "ioctl - TIOCGETD - OK" );
+  sc = ioctl(Test_fd, TIOCGETD, &InitialDiscipline);
+  rtems_test_assert( sc == 0 );
+
+  puts( "ioctl - TIOCSETD - OK" );
+  sc = ioctl(Test_fd, TIOCSETD, &pppdisc);
+  rtems_test_assert( sc == 0 );
+}
+
+void ioctl_it(void)
+{
+  int rc;
+
+  puts( "ioctl(" TERMIOS_TEST_DRIVER_DEVICE_NAME ") - OK " );
+  rc = ioctl( Test_fd, 0xFFFF, NULL );
+  rtems_test_assert( rc == 0 );
+}
+
+void close_it(void)
+{
+  int rc;
+
+  puts( "close(" TERMIOS_TEST_DRIVER_DEVICE_NAME ") - OK " );
+  rc = close( Test_fd );
+  rtems_test_assert( rc == 0 );
+}
+
+void write_it(void)
+{
+  ssize_t sc;
+  char    ch[10] = "PPPD TEST";
+
+  puts( "write(PPPD TEST) - OK " );
+  sc = write(Test_fd, ch, sizeof(ch));
+  rtems_test_assert( sc == sizeof(ch) );
+}
+
+uint8_t read_helper_buffer[256];
+
+void read_helper(
+  int         fd,
+  const char *expected
+)
+{
+  int    rc;
+  size_t len;
+
+  len = strlen( expected );
+
+  ppp_test_driver_set_rx( expected, len );
+  printf( "\nReading (expected):\n" );
+  rtems_print_buffer( (unsigned char *)expected, len-1 );
+
+  rc = read( fd, read_helper_buffer, sizeof(read_helper_buffer) );
+  rtems_test_assert( rc != -1 );
+
+  printf( "Read %d bytes from read(2)\n", rc );
+  rtems_print_buffer( read_helper_buffer, rc );
+}
+
+void read_it(void)
+{
+  read_helper( Test_fd, "This is test PPP input." );
+}
+
+rtems_task Init(
+  rtems_task_argument argument
+)
+{
+  puts( "\n\n*** TEST TERMIOS06 ***" );
+
+  pppasyncattach();
+  open_it();
+  set_discipline();
+  write_it();
+  ioctl_it();
+  read_it();
+  close_it();
+<span style="background-color: #FF0000">  </span>
+  puts( "*** END OF TEST TERMIOS06 ***" );
+
+  rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_EXTRA_DRIVERS TERMIOS_TEST_DRIVER_TABLE_ENTRY
+
+/* one for the console and one for the test port */
+#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 3
+
+/* we need to be able to open the test device */
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
+
+#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/libtests/termios06/termios06.doc:1.1
--- /dev/null   Mon Jul  5 17:13:37 2010
+++ rtems/testsuites/libtests/termios06/termios06.doc   Mon Jul  5 16:14:39 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:  termios06
+
+directives:
+
+  various parts of termios that deal with PPPDISC
+
+concepts:
+
++ Exercise PPPDISC functionality in termios
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/termios06/termios06.scn:1.1
--- /dev/null   Mon Jul  5 17:13:37 2010
+++ rtems/testsuites/libtests/termios06/termios06.scn   Mon Jul  5 16:14:39 2010
</font><font color='#997700'>@@ -0,0 +1,42 @@
</font><font color='#000088'>+*** TEST TERMIOS06 ***
+open(/dev/test) - OK<span style="background-color: #FF0000"> </span>
+ioctl - TIOCGETD - OK
+ioctl - TIOCSETD - OK
+pppopen called
+write(PPPD TEST) - OK<span style="background-color: #FF0000"> </span>
+pppwrite called - 10 bytes
+50 50 50 44 20 54 45 53 54 00                   |PPPD TEST.      |
+pppstart called
+ioctl(/dev/test) - OK<span style="background-color: #FF0000"> </span>
+pppioctl called
+
+Reading (expected):
+54 68 69 73 20 69 73 20 74 65 73 74 20 50 50 50 |This is test PPP|
+20 69 6e 70 75 74                               | input          |
+pppread calledpppinput called - with (T)
+pppinput called - with (h)
+pppinput called - with (i)
+pppinput called - with (s)
+pppinput called - with ( )
+pppinput called - with (i)
+pppinput called - with (s)
+pppinput called - with ( )
+pppinput called - with (t)
+pppinput called - with (e)
+pppinput called - with (s)
+pppinput called - with (t)
+pppinput called - with ( )
+pppinput called - with (P)
+pppinput called - with (P)
+pppinput called - with (P)
+pppinput called - with ( )
+pppinput called - with (i)
+pppinput called - with (n)
+pppinput called - with (p)
+pppinput called - with (u)
+pppinput called - with (t)
+pppinput called - with (.)
+Read 0 bytes from read(2)
+close(/dev/test) - OK<span style="background-color: #FF0000"> </span>
+pppclose called
+*** END OF TEST TERMIOS06 ***
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/termios06/test_pppd.c:1.1
--- /dev/null   Mon Jul  5 17:13:37 2010
+++ rtems/testsuites/libtests/termios06/test_pppd.c     Mon Jul  5 16:14:39 2010
</font><font color='#997700'>@@ -0,0 +1,101 @@
</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 <tmacros.h>
+#include <termios.h>
+#include <rtems/termiostypes.h>
+#include <rtems/dumpbuf.h>
+
+int  pppopen(struct rtems_termios_tty *tty);
+int  pppclose(struct rtems_termios_tty *tty);
+int  pppread(struct rtems_termios_tty *tty, rtems_libio_rw_args_t *rw_args);
+int  pppwrite(struct rtems_termios_tty *tty, rtems_libio_rw_args_t *rw_args);
+int  pppioctl(struct rtems_termios_tty *tty, rtems_libio_ioctl_args_t *args);
+int  pppinput(int c, struct rtems_termios_tty *tty);
+int  pppstart(struct rtems_termios_tty *tp);
+
+/*
+ * Define the PPP line discipline.
+ */
+
+static struct rtems_termios_linesw pppdisc = {
+  pppopen, pppclose, pppread, pppwrite,
+  pppinput, pppstart, pppioctl, NULL
+};
+
+const char *RXExpected;
+size_t      RXLength;
+
+void ppp_test_driver_set_rx( const char *expected, size_t len )
+{
+  RXExpected = expected;
+  RXLength   = len;
+}
+
+void pppasyncattach(void)
+{
+  rtems_termios_linesw[PPPDISC] = pppdisc;
+}
+
+int  pppopen(struct rtems_termios_tty *tty)
+{
+  puts( "pppopen called" );
+  return 0;
+}
+
+int  pppclose(struct rtems_termios_tty *tty)
+{
+  puts( "pppclose called" );
+  return 0;
+}
+
+int  pppread(struct rtems_termios_tty *tty, rtems_libio_rw_args_t *rw_args)
+{
+  puts( "pppread called" );
+<span style="background-color: #FF0000">  </span>
+  rtems_termios_enqueue_raw_characters( tty, (char *)RXExpected, RXLength );
+<span style="background-color: #FF0000">  </span>
+  RXExpected = NULL;
+  RXLength = 0;
+  return 0;
+}
+
+int  pppwrite(struct rtems_termios_tty *tty, rtems_libio_rw_args_t *rw_args)
+{
+  int                           maximum    = rw_args->count;
+  char                         *out_buffer = rw_args->buffer;<span style="background-color: #FF0000"> </span>
+
+  printf( "pppwrite called - %d bytes\n", maximum );
+  rtems_print_buffer( (unsigned char *) out_buffer, maximum );
+  rw_args->bytes_moved = maximum;
+  rtems_termios_dequeue_characters( tty, 1 );
+  return 0;
+}
+
+int  pppioctl(struct rtems_termios_tty *tty, rtems_libio_ioctl_args_t *args)
+{
+  puts( "pppioctl called" );
+  return 0;
+}
+
+int  pppinput(int c, struct rtems_termios_tty *tty)
+{
+  printf( "pppinput called - with (%c)\n", c );
+  return 0;
+}
+
+int  pppstart(struct rtems_termios_tty *tp)
+{
+  puts( "pppstart called" );
+  return 0;
+}
+
+
</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-07-05 Joel Sherrill <joel.sherrill@oarcorp.com>

        * libcsupport/src/getlogin.c: Formatting.  Add EFAULT.
        * libcsupport/src/termios.c: Formatting.
</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.2488&r2=text&tr2=1.2489&diff_format=h">M</a></td><td width='1%'>1.2489</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/getlogin.c.diff?r1=text&tr1=1.2&r2=text&tr2=1.3&diff_format=h">M</a></td><td width='1%'>1.3</td><td width='100%'>cpukit/libcsupport/src/getlogin.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/termios.c.diff?r1=text&tr1=1.62&r2=text&tr2=1.63&diff_format=h">M</a></td><td width='1%'>1.63</td><td width='100%'>cpukit/libcsupport/src/termios.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2488 rtems/cpukit/ChangeLog:1.2489
--- rtems/cpukit/ChangeLog:1.2488       Sun Jul  4 09:53:42 2010
+++ rtems/cpukit/ChangeLog      Mon Jul  5 16:31:55 2010
</font><font color='#997700'>@@ -1,3 +1,8 @@
</font><font color='#000088'>+2010-07-05    Joel Sherrill <joel.sherrill@oarcorp.com>
+
+       * libcsupport/src/getlogin.c: Formatting.  Add EFAULT.
+       * libcsupport/src/termios.c: Formatting.
+
</font> 2010-07-04        Joel Sherrill <joel.sherrill@oarcorp.com>
 
        * libblock/include/rtems/ide_part_table.h, libblock/src/bdbuf.c,

<font color='#006600'>diff -u rtems/cpukit/libcsupport/src/getlogin.c:1.2 rtems/cpukit/libcsupport/src/getlogin.c:1.3
--- rtems/cpukit/libcsupport/src/getlogin.c:1.2 Sun Apr 18 01:05:34 2004
+++ rtems/cpukit/libcsupport/src/getlogin.c     Mon Jul  5 16:31:56 2010
</font><font color='#997700'>@@ -19,46 +19,40 @@
</font> #include <unistd.h>
 #include <pwd.h>
 
<font color='#880000'>-/*PAGE
- *
</font><font color='#000088'>+/*
</font>  *  4.2.4 Get User Name, P1003.1b-1993, p. 87
  *
  *  NOTE:  P1003.1c/D10, p. 49 adds getlogin_r().
  */
<font color='#880000'>-
-/*
- * MACRO in userenv.h
- *
-static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];
-*/
-
</font> char *getlogin( void )
 {
   (void) getlogin_r( _POSIX_types_Getlogin_buffer, LOGIN_NAME_MAX );
   return _POSIX_types_Getlogin_buffer;
 }
 
<font color='#880000'>-/*PAGE
- *
</font><font color='#000088'>+/*
</font>  *  4.2.4 Get User Name, P1003.1b-1993, p. 87
  *
  *  NOTE:  P1003.1c/D10, p. 49 adds getlogin_r().
  */
<font color='#880000'>-
</font> int getlogin_r(
   char   *name,
   size_t  namesize
 )
 {
   struct passwd *pw;
<font color='#000088'>+
+  if ( !name )<span style="background-color: #FF0000"> </span>
+    return EFAULT;
+
</font>   if ( namesize < LOGIN_NAME_MAX )
     return ERANGE;
 
<font color='#880000'>-  pw=getpwuid(getuid());
-  if (!pw) {
-   strcpy(name,"");
</font><font color='#000088'>+  pw = getpwuid(getuid());
+  if ( !pw ) {
+   strcpy( name, "" );
</font>   } else {
<font color='#880000'>-   strncpy(name,pw->pw_name,LOGIN_NAME_MAX);
-  };
</font><font color='#000088'>+   strncpy( name, pw->pw_name, LOGIN_NAME_MAX );
+  }
</font>   return 0;
 }

<font color='#006600'>diff -u rtems/cpukit/libcsupport/src/termios.c:1.62 rtems/cpukit/libcsupport/src/termios.c:1.63
--- rtems/cpukit/libcsupport/src/termios.c:1.62 Mon Jun 28 13:48:32 2010
+++ rtems/cpukit/libcsupport/src/termios.c      Mon Jul  5 16:31:56 2010
</font><font color='#997700'>@@ -60,13 +60,14 @@
</font>   { NULL,  NULL,  NULL,  NULL, \
     NULL,  NULL,  NULL,  NULL }
 /*
<font color='#880000'>- * FIXME: change rtems_termios_linesw entries consistant with rtems_termios_linesw entry usage...
</font><font color='#000088'>+ * FIXME: change rtems_termios_linesw entries consistent
+ *        with rtems_termios_linesw entry usage...
</font>  */
 struct  rtems_termios_linesw rtems_termios_linesw[MAXLDISC] =
 {
   NODISC(0),    /* 0- termios-built-in */
   NODISC(1),    /* 1- defunct */
<font color='#880000'>-  NODISC(2),              /* 2- NTTYDISC */
</font><font color='#000088'>+  NODISC(2),    /* 2- NTTYDISC */
</font>   NODISC(3),    /* TABLDISC */
   NODISC(4),    /* SLIPDISC */
   NODISC(5),    /* PPPDISC */
<font color='#997700'>@@ -74,7 +75,8 @@
</font>   NODISC(7),    /* loadable */
 };
 
<font color='#880000'>-int  rtems_termios_nlinesw = sizeof (rtems_termios_linesw) / sizeof (rtems_termios_linesw[0]);
</font><font color='#000088'>+int  rtems_termios_nlinesw =
+       sizeof (rtems_termios_linesw) / sizeof (rtems_termios_linesw[0]);
</font> 
 extern struct rtems_termios_tty *rtems_termios_ttyHead;
 extern struct rtems_termios_tty *rtems_termios_ttyTail;
<font color='#997700'>@@ -111,7 +113,7 @@
</font>   rtems_device_minor_number      minor,
   void                          *arg,
   const rtems_termios_callbacks *callbacks
<font color='#880000'>-  )
</font><font color='#000088'>+)
</font> {
   rtems_status_code sc;
   rtems_libio_open_close_args_t *args = arg;
<font color='#997700'>@@ -120,14 +122,16 @@
</font>   /*
    * See if the device has already been opened
    */
<font color='#880000'>-  sc = rtems_semaphore_obtain (rtems_termios_ttyMutex,
-             RTEMS_WAIT, RTEMS_NO_TIMEOUT);
</font><font color='#000088'>+  sc = rtems_semaphore_obtain(
+    rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
</font>   if (sc != RTEMS_SUCCESSFUL)
     return sc;
<font color='#000088'>+
</font>   for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) {
     if ((tty->major == major) && (tty->minor == minor))
       break;
   }
<font color='#000088'>+
</font>   if (tty == NULL) {
     static char c = 'a';
 
<font color='#997700'>@@ -307,20 +311,19 @@
</font>   args->iop->data1 = tty;
   if (!tty->refcount++) {
     if (tty->device.firstOpen)
<font color='#880000'>-    (*tty->device.firstOpen)(major, minor, arg);
</font><font color='#000088'>+      (*tty->device.firstOpen)(major, minor, arg);
+
</font>     /*
      * start I/O tasks, if needed
      */
     if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
<font color='#880000'>-      sc = rtems_task_start(tty->rxTaskId,
-          rtems_termios_rxdaemon,
-          (rtems_task_argument)tty);
</font><font color='#000088'>+      sc = rtems_task_start(
+        tty->rxTaskId, rtems_termios_rxdaemon, (rtems_task_argument)tty);
</font>       if (sc != RTEMS_SUCCESSFUL)
         rtems_fatal_error_occurred (sc);
 
<font color='#880000'>-      sc = rtems_task_start(tty->txTaskId,
-          rtems_termios_txdaemon,
-          (rtems_task_argument)tty);
</font><font color='#000088'>+      sc = rtems_task_start(
+        tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty);
</font>       if (sc != RTEMS_SUCCESSFUL)
         rtems_fatal_error_occurred (sc);
     }
<font color='#997700'>@@ -343,9 +346,8 @@
</font>     while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) {
       tty->rawOutBufState = rob_wait;
       rtems_interrupt_enable (level);
<font color='#880000'>-      sc = rtems_semaphore_obtain (tty->rawOutBuf.Semaphore,
-              RTEMS_WAIT,
-              RTEMS_NO_TIMEOUT);
</font><font color='#000088'>+      sc = rtems_semaphore_obtain(
+        tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
</font>       if (sc != RTEMS_SUCCESSFUL)
         rtems_fatal_error_occurred (sc);
       rtems_interrupt_disable (level);
<font color='#997700'>@@ -371,31 +373,25 @@
</font>        * call discipline-specific close
        */
       sc = rtems_termios_linesw[tty->t_line].l_close(tty);
<font color='#880000'>-    }
-    else {
</font><font color='#000088'>+    } else {
</font>       /*
        * default: just flush output buffer
        */
<font color='#880000'>-      sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
</font><font color='#000088'>+      sc = rtems_semaphore_obtain(tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
</font>       if (sc != RTEMS_SUCCESSFUL) {
         rtems_fatal_error_occurred (sc);
       }
<font color='#880000'>-            drainOutput (tty);
</font><font color='#000088'>+      drainOutput (tty);
</font>     }
 
<font color='#880000'>-    if (tty->device.outputUsesInterrupts
-        == TERMIOS_TASK_DRIVEN) {
</font><font color='#000088'>+    if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
</font>       /*
        * send "terminate" to I/O tasks
        */
<font color='#880000'>-      sc = rtems_event_send(
-                                  tty->rxTaskId,
-          TERMIOS_RX_TERMINATE_EVENT);
</font><font color='#000088'>+      sc = rtems_event_send( tty->rxTaskId, TERMIOS_RX_TERMINATE_EVENT );
</font>       if (sc != RTEMS_SUCCESSFUL)
         rtems_fatal_error_occurred (sc);
<font color='#880000'>-      sc = rtems_event_send(
-                                  tty->txTaskId,
-          TERMIOS_TX_TERMINATE_EVENT);
</font><font color='#000088'>+      sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT );
</font>       if (sc != RTEMS_SUCCESSFUL)
         rtems_fatal_error_occurred (sc);
     }
<font color='#997700'>@@ -406,19 +402,19 @@
</font>       if ( rtems_termios_ttyTail != NULL ) {
         rtems_termios_ttyTail->forw = NULL;
       }
<font color='#880000'>-    }
-    else {
</font><font color='#000088'>+    } else {
</font>       tty->forw->back = tty->back;
     }
<font color='#000088'>+
</font>     if (tty->back == NULL) {
       rtems_termios_ttyHead = tty->forw;
       if ( rtems_termios_ttyHead != NULL ) {
         rtems_termios_ttyHead->back = NULL;
       }
<font color='#880000'>-    }
-    else {
</font><font color='#000088'>+    } else {
</font>       tty->back->forw = tty->forw;
     }
<font color='#000088'>+
</font>     rtems_semaphore_delete (tty->isem);
     rtems_semaphore_delete (tty->osem);
     rtems_semaphore_delete (tty->rawOutBuf.Semaphore);
<font color='#997700'>@@ -467,17 +463,16 @@
</font>       tty->flow_ctrl &= ~FL_OSTOP;
       /* check for chars in output buffer (or rob_state?) */
       if (tty->rawOutBufState != rob_idle) {
<font color='#880000'>-  /* if chars available, call write function... */
-  (*tty->device.write)(tty->minor,
-         &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
</font><font color='#000088'>+        /* if chars available, call write function... */
+        (*tty->device.write)(
+          tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
</font>       }
       /* reenable interrupts */
       rtems_interrupt_enable(level);
     }
   }
   /* check for incoming XON/XOFF flow control switched off */
<font color='#880000'>-  if (( tty->flow_ctrl & FL_MDXOF) &&
-      !(tty->termios.c_iflag & IXOFF)) {
</font><font color='#000088'>+  if (( tty->flow_ctrl & FL_MDXOF) && !(tty->termios.c_iflag & IXOFF)) {
</font>     /* clear related flags in flow_ctrl */
     tty->flow_ctrl &= ~(FL_MDXOF);
     /* FIXME: what happens, if we had sent XOFF but not yet XON? */
<font color='#997700'>@@ -551,8 +546,7 @@
</font>       tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
       tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
       tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
<font color='#880000'>-    }
-    else {
</font><font color='#000088'>+    } else {
</font>       tty->vtimeTicks = tty->termios.c_cc[VTIME] *<span style="background-color: #FF0000"> </span>
                     rtems_clock_get_ticks_per_second() / 10;
       if (tty->termios.c_cc[VTIME]) {
<font color='#997700'>@@ -562,14 +556,12 @@
</font>           tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
         else
           tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks;
<font color='#880000'>-      }
-      else {
</font><font color='#000088'>+      } else {
</font>         if (tty->termios.c_cc[VMIN]) {
           tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
           tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
           tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
<font color='#880000'>-        }
-        else {
</font><font color='#000088'>+        } else {
</font>           tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT;
         }
       }
<font color='#997700'>@@ -615,16 +607,16 @@
</font>     *(int*)(args->buffer)=tty->t_line;
     break;
 #endif
<font color='#880000'>-   case FIONREAD:
-    {
-    int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head;
-    if ( rawnc < 0 )
-      rawnc += tty->rawInBuf.Size;
-    /* Half guess that this is the right operation */
-    *(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
</font><font color='#000088'>+   case FIONREAD: {
+      int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head;
+      if ( rawnc < 0 )
+        rawnc += tty->rawInBuf.Size;
+      /* Half guess that this is the right operation */
+      *(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
</font>     }
     break;
   }
<font color='#000088'>+
</font>   rtems_semaphore_release (tty->osem);
   args->ioctl_return = sc;
   return sc;
<font color='#997700'>@@ -665,9 +657,8 @@
</font>     while (newHead == tty->rawOutBuf.Tail) {
       tty->rawOutBufState = rob_wait;
       rtems_interrupt_enable (level);
<font color='#880000'>-      sc = rtems_semaphore_obtain (tty->rawOutBuf.Semaphore,
-              RTEMS_WAIT,
-              RTEMS_NO_TIMEOUT);
</font><font color='#000088'>+      sc = rtems_semaphore_obtain(
+        tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
</font>       if (sc != RTEMS_SUCCESSFUL)
         rtems_fatal_error_occurred (sc);
       rtems_interrupt_disable (level);
<font color='#997700'>@@ -679,8 +670,7 @@
</font>       if (!(tty->flow_ctrl & FL_ORCVXOF)) {
         (*tty->device.write)(tty->minor,
       (char *)&tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
<font color='#880000'>-      }
-      else {
</font><font color='#000088'>+      } else {
</font>         /* remember that output has been stopped due to flow ctrl*/
         tty->flow_ctrl |= FL_OSTOP;
       }
<font color='#997700'>@@ -769,8 +759,7 @@
</font>     while (count--)
       oproc (*buffer++, tty);
     args->bytes_moved = args->count;
<font color='#880000'>-  }
-  else {
</font><font color='#000088'>+  } else {
</font>     rtems_termios_puts (args->buffer, args->count, tty);
     args->bytes_moved = args->count;
   }
<font color='#997700'>@@ -784,15 +773,15 @@
</font> static void
 echo (unsigned char c, struct rtems_termios_tty *tty)
 {
<font color='#880000'>-  if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) {
</font><font color='#000088'>+  if ((tty->termios.c_lflag & ECHOCTL) &&
+       iscntrl(c) && (c != '\t') && (c != '\n')) {
</font>     char echobuf[2];
 
     echobuf[0] = '^';
     echobuf[1] = c ^ 0x40;
     rtems_termios_puts (echobuf, 2, tty);
     tty->column += 2;
<font color='#880000'>-  }
-  else {
</font><font color='#000088'>+  } else {
</font>     oproc (c, tty);
   }
 }
<font color='#997700'>@@ -820,14 +809,14 @@
</font>       return;
     }
   }
<font color='#000088'>+
</font>   while (tty->ccount) {
     unsigned char c = tty->cbuf[--tty->ccount];
 
     if (tty->termios.c_lflag & ECHO) {
       if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
         echo (tty->termios.c_cc[VERASE], tty);
<font color='#880000'>-      }
-      else if (c == '\t') {
</font><font color='#000088'>+      } else if (c == '\t') {
</font>         int col = tty->read_start_column;
         int i = 0;
 
<font color='#997700'>@@ -838,12 +827,10 @@
</font>           c = tty->cbuf[i++];
           if (c == '\t') {
             col = (col | 7) + 1;
<font color='#880000'>-          }
-          else if (iscntrl (c)) {
</font><font color='#000088'>+          } else if (iscntrl (c)) {
</font>             if (tty->termios.c_lflag & ECHOCTL)
               col += 2;
<font color='#880000'>-          }
-          else {
</font><font color='#000088'>+          } else {
</font>             col++;
           }
         }
<font color='#997700'>@@ -882,17 +869,19 @@
</font> {
   if (tty->termios.c_iflag & ISTRIP)
     c &= 0x7f;
<font color='#000088'>+
</font>   if (tty->termios.c_iflag & IUCLC)
     c = tolower (c);
<font color='#000088'>+
</font>   if (c == '\r') {
     if (tty->termios.c_iflag & IGNCR)
       return 0;
     if (tty->termios.c_iflag & ICRNL)
       c = '\n';
<font color='#880000'>-  }
-  else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
</font><font color='#000088'>+  } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
</font>     c = '\r';
   }
<font color='#000088'>+
</font>   if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
     if (c == tty->termios.c_cc[VERASE]) {
       erase (tty, 0);
<font color='#997700'>@@ -904,15 +893,13 @@
</font>     }
     else if (c == tty->termios.c_cc[VEOF]) {
       return 1;
<font color='#880000'>-    }
-    else if (c == '\n') {
</font><font color='#000088'>+    } else if (c == '\n') {
</font>       if (tty->termios.c_lflag & (ECHO | ECHONL))
         echo (c, tty);
       tty->cbuf[tty->ccount++] = c;
       return 1;
<font color='#880000'>-    }
-    else if ((c == tty->termios.c_cc[VEOL])
-          || (c == tty->termios.c_cc[VEOL2])) {
</font><font color='#000088'>+    } else if ((c == tty->termios.c_cc[VEOL]) ||
+               (c == tty->termios.c_cc[VEOL2])) {
</font>       if (tty->termios.c_lflag & ECHO)
         echo (c, tty);
       tty->cbuf[tty->ccount++] = c;
<font color='#997700'>@@ -966,15 +953,14 @@
</font>       n = (*tty->device.pollRead)(tty->minor);
       if (n < 0) {
         rtems_task_wake_after (1);
<font color='#880000'>-      }
-      else {
</font><font color='#000088'>+      } else {
</font>         if  (siproc (n, tty))
           break;
       }
     }
<font color='#880000'>-  }
-  else {
</font><font color='#000088'>+  } else {
</font>     rtems_interval then, now;
<font color='#000088'>+
</font>     then = rtems_clock_get_ticks_since_boot();
     for (;;) {
       n = (*tty->device.pollRead)(tty->minor);
<font color='#997700'>@@ -986,8 +972,7 @@
</font>               break;
             }
           }
<font color='#880000'>-        }
-        else {
</font><font color='#000088'>+        } else {
</font>           if (!tty->termios.c_cc[VTIME])
             break;
           now = rtems_clock_get_ticks_since_boot();
<font color='#997700'>@@ -996,8 +981,7 @@
</font>           }
         }
         rtems_task_wake_after (1);
<font color='#880000'>-      }
-      else {
</font><font color='#000088'>+      } else {
</font>         siproc (n, tty);
         if (tty->ccount >= tty->termios.c_cc[VMIN])
           break;
<font color='#997700'>@@ -1041,11 +1025,9 @@
</font>             && ((tty->rawOutBufState == rob_idle)
           || (tty->flow_ctrl & FL_OSTOP))) {
           /* XON should be sent now... */
<font color='#880000'>-          (*tty->device.write)(tty->minor,
-        (void *)&(tty->termios.c_cc[VSTART]),
-        1);
-        }
-        else if (tty->flow_ctrl & FL_MDRTS) {
</font><font color='#000088'>+          (*tty->device.write)(
+            tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
+        } else if (tty->flow_ctrl & FL_MDRTS) {
</font>           tty->flow_ctrl &= ~FL_IRTSOFF;
           /* activate RTS line */
           if (tty->device.startRemoteTx != NULL) {
<font color='#997700'>@@ -1056,10 +1038,9 @@
</font> 
       /* continue processing new character */
       if (tty->termios.c_lflag & ICANON) {
<font color='#880000'>-        if  (siproc (c, tty))
</font><font color='#000088'>+        if (siproc (c, tty))
</font>           wait = 0;
<font color='#880000'>-      }
-      else {
</font><font color='#000088'>+      } else {
</font>         siproc (c, tty);
         if (tty->ccount >= tty->termios.c_cc[VMIN])
           wait = 0;
<font color='#997700'>@@ -1071,9 +1052,8 @@
</font>      * Wait for characters
      */
     if ( wait ) {
<font color='#880000'>-      sc = rtems_semaphore_obtain (tty->rawInBuf.Semaphore,
-        tty->rawInBufSemaphoreOptions,
-        timeout);
</font><font color='#000088'>+      sc = rtems_semaphore_obtain(
+        tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout);
</font>       if (sc != RTEMS_SUCCESSFUL)
         break;
     }
<font color='#997700'>@@ -1093,20 +1073,23 @@
</font>   sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
   if (sc != RTEMS_SUCCESSFUL)
     return sc;
<font color='#000088'>+
</font>   if (rtems_termios_linesw[tty->t_line].l_read != NULL) {
     sc = rtems_termios_linesw[tty->t_line].l_read(tty,args);
     tty->tty_rcvwakeup = 0;
     rtems_semaphore_release (tty->isem);
     return sc;
   }
<font color='#000088'>+
</font>   if (tty->cindex == tty->ccount) {
     tty->cindex = tty->ccount = 0;
     tty->read_start_column = tty->column;
<font color='#880000'>-    if (tty->device.pollRead != NULL
-        && tty->device.outputUsesInterrupts == TERMIOS_POLLED)
</font><font color='#000088'>+    if (tty->device.pollRead != NULL &&
+        tty->device.outputUsesInterrupts == TERMIOS_POLLED)
</font>       sc = fillBufferPoll (tty);
     else
       sc = fillBufferQueue (tty);
<font color='#000088'>+
</font>     if (sc != RTEMS_SUCCESSFUL)
       tty->cindex = tty->ccount = 0;
   }
<font color='#997700'>@@ -1199,15 +1182,14 @@
</font>         tty->flow_ctrl &= ~FL_OSTOP;
         /* check for chars in output buffer (or rob_state?) */
         if (tty->rawOutBufState != rob_idle) {
<font color='#880000'>-        /* if chars available, call write function... */
-        (*tty->device.write)(tty->minor,
-         &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1);
</font><font color='#000088'>+          /* if chars available, call write function... */
+          (*tty->device.write)(
+            tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1);
</font>         }
         /* reenable interrupts */
         rtems_interrupt_enable(level);
       }
<font color='#880000'>-    }
-    else {
</font><font color='#000088'>+    } else {
</font>       newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size;
       /* if chars_in_buffer > highwater                */
       rtems_interrupt_disable(level);
<font color='#997700'>@@ -1226,8 +1208,7 @@
</font>             (*tty->device.write)(tty->minor,
                 (void *)&(tty->termios.c_cc[VSTOP]), 1);
           }
<font color='#880000'>-        }
-        else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
</font><font color='#000088'>+        } else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
</font>           tty->flow_ctrl |= FL_IRTSOFF;
           /* deactivate RTS line */
           if (tty->device.stopRemoteTx != NULL) {
<font color='#997700'>@@ -1241,8 +1222,7 @@
</font> 
       if (newTail == tty->rawInBuf.Head) {
         dropped++;
<font color='#880000'>-      }
-      else {
</font><font color='#000088'>+      } else {
</font>         tty->rawInBuf.theBuf[newTail] = c;
         tty->rawInBuf.Tail = newTail;
 
<font color='#997700'>@@ -1256,6 +1236,7 @@
</font>       }
     }
   }
<font color='#000088'>+
</font>   tty->rawInBufDropped += dropped;
   rtems_semaphore_release (tty->rawInBuf.Semaphore);
   return dropped;
<font color='#997700'>@@ -1277,8 +1258,7 @@
</font>   if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF))
       == (FL_MDXOF | FL_IREQXOF)) {
     /* XOFF should be sent now... */
<font color='#880000'>-    (*tty->device.write)(tty->minor,
-        (void *)&(tty->termios.c_cc[VSTOP]), 1);
</font><font color='#000088'>+    (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1);
</font> 
     rtems_interrupt_disable(level);
     tty->t_dqlen--;
<font color='#997700'>@@ -1286,8 +1266,8 @@
</font>     rtems_interrupt_enable(level);
 
     nToSend = 1;
<font color='#880000'>-  }
-  else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) {
</font><font color='#000088'>+
+  } else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) {
</font>     /* NOTE: send XON even, if no longer in XON/XOFF mode... */
     /* XON should be sent now... */
     /*
<font color='#997700'>@@ -1296,8 +1276,7 @@
</font>      * buffer, although the corresponding data is not yet out!
      * Therefore the dequeue "length" should be reduced by 1
      */
<font color='#880000'>-    (*tty->device.write)(tty->minor,
-             (void *)&(tty->termios.c_cc[VSTART]), 1);
</font><font color='#000088'>+    (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
</font> 
     rtems_interrupt_disable(level);
     tty->t_dqlen--;
<font color='#997700'>@@ -1305,8 +1284,7 @@
</font>     rtems_interrupt_enable(level);
 
     nToSend = 1;
<font color='#880000'>-  }
-  else {
</font><font color='#000088'>+  } else {
</font>     if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) {
       /*
        * buffer was empty
<font color='#997700'>@@ -1333,6 +1311,7 @@
</font>        */
       rtems_semaphore_release (tty->rawOutBuf.Semaphore);
     }
<font color='#000088'>+
</font>     if (newTail == tty->rawOutBuf.Head) {
       /*
        * Buffer has become empty
<font color='#997700'>@@ -1357,8 +1336,7 @@
</font>       tty->rawOutBufState = rob_busy; /*apm*/
       rtems_interrupt_enable(level);
       nToSend = 0;
<font color='#880000'>-    }
-    else {
</font><font color='#000088'>+    } else {
</font>       /*
        * Buffer not empty, start tranmitter
        */
<font color='#997700'>@@ -1373,9 +1351,8 @@
</font>         nToSend = 1;
       }
       tty->rawOutBufState = rob_busy; /*apm*/
<font color='#880000'>-      (*tty->device.write)(tty->minor,
-         &tty->rawOutBuf.theBuf[newTail],
-         nToSend);
</font><font color='#000088'>+      (*tty->device.write)(
+        tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend);
</font>     }
     tty->rawOutBuf.Tail = newTail; /*apm*/
   }
<font color='#997700'>@@ -1406,8 +1383,7 @@
</font>     /*
      * send wake up to transmitter task
      */
<font color='#880000'>-    sc = rtems_event_send(tty->txTaskId,
-              TERMIOS_TX_START_EVENT);
</font><font color='#000088'>+    sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT);
</font>     if (sc != RTEMS_SUCCESSFUL)
       rtems_fatal_error_occurred (sc);
     return 0; /* nothing to output in IRQ... */
<font color='#997700'>@@ -1438,27 +1414,28 @@
</font>     /*
      * wait for rtems event
      */
<font color='#880000'>-    rtems_event_receive((TERMIOS_TX_START_EVENT |
-             TERMIOS_TX_TERMINATE_EVENT),
-            RTEMS_EVENT_ANY | RTEMS_WAIT,
-            RTEMS_NO_TIMEOUT,
-            &the_event);
</font><font color='#000088'>+    rtems_event_receive(
+       (TERMIOS_TX_START_EVENT | TERMIOS_TX_TERMINATE_EVENT),
+       RTEMS_EVENT_ANY | RTEMS_WAIT,
+       RTEMS_NO_TIMEOUT,
+       &the_event
+    );
</font>     if ((the_event & TERMIOS_TX_TERMINATE_EVENT) != 0) {
       tty->txTaskId = 0;
       rtems_task_delete(RTEMS_SELF);
     }
<font color='#880000'>-    else {
-      /*
-       * call any line discipline start function
-       */
-      if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
-        rtems_termios_linesw[tty->t_line].l_start(tty);
-      }
-      /*
-       * try to push further characters to device
-       */
-      rtems_termios_refill_transmitter(tty);
</font><font color='#000088'>+
+    /*
+     * call any line discipline start function
+     */
+    if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
+      rtems_termios_linesw[tty->t_line].l_start(tty);
</font>     }
<font color='#000088'>+
+    /*
+     * try to push further characters to device
+     */
+    rtems_termios_refill_transmitter(tty);
</font>   }
 }
 
<font color='#997700'>@@ -1471,32 +1448,32 @@
</font>   rtems_event_set the_event;
   int c;
   char c_buf;
<font color='#000088'>+
</font>   while (1) {
     /*
      * wait for rtems event
      */
<font color='#880000'>-    rtems_event_receive((TERMIOS_RX_PROC_EVENT |
-             TERMIOS_RX_TERMINATE_EVENT),
-            RTEMS_EVENT_ANY | RTEMS_WAIT,
-            RTEMS_NO_TIMEOUT,
-            &the_event);
</font><font color='#000088'>+    rtems_event_receive(
+      (TERMIOS_RX_PROC_EVENT | TERMIOS_RX_TERMINATE_EVENT),
+      RTEMS_EVENT_ANY | RTEMS_WAIT,
+      RTEMS_NO_TIMEOUT,
+      &the_event
+    );
</font>     if ((the_event & TERMIOS_RX_TERMINATE_EVENT) != 0) {
       tty->rxTaskId = 0;
       rtems_task_delete(RTEMS_SELF);
     }
<font color='#880000'>-    else {
</font><font color='#000088'>+
+    /*
+     * do something
+     */
+    c = tty->device.pollRead(tty->minor);
+    if (c != EOF) {
</font>       /*
<font color='#880000'>-       * do something
</font><font color='#000088'>+       * pollRead did call enqueue on its own
</font>        */
<font color='#880000'>-      c = tty->device.pollRead(tty->minor);
-      if (c != EOF) {
-        /*
-         * pollRead did call enqueue on its own
-         */
-        c_buf = c;
-        rtems_termios_enqueue_raw_characters (
-              tty,&c_buf,1);
-      }
</font><font color='#000088'>+      c_buf = c;
+      rtems_termios_enqueue_raw_characters ( tty,&c_buf,1);
</font>     }
   }
 }
</pre>
<p> </p>
<a name='cs3'></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-07-05 Joel Sherrill <joel.sherrill@oarcorp.com>

        * psxid01/init.c, psxid01/psxid01.doc, psxid01/psxid01.scn: Add test
        cases.
</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.283&r2=text&tr2=1.284&diff_format=h">M</a></td><td width='1%'>1.284</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/psxid01/init.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%'>testsuites/psxtests/psxid01/init.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxid01/psxid01.doc.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%'>testsuites/psxtests/psxid01/psxid01.doc</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxid01/psxid01.scn.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%'>testsuites/psxtests/psxid01/psxid01.scn</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtests/ChangeLog:1.283 rtems/testsuites/psxtests/ChangeLog:1.284
--- rtems/testsuites/psxtests/ChangeLog:1.283   Fri Jul  2 13:51:48 2010
+++ rtems/testsuites/psxtests/ChangeLog Mon Jul  5 16:32:46 2010
</font><font color='#997700'>@@ -1,3 +1,8 @@
</font><font color='#000088'>+2010-07-05    Joel Sherrill <joel.sherrill@oarcorp.com>
+
+       * psxid01/init.c, psxid01/psxid01.doc, psxid01/psxid01.scn: Add test
+       cases.
+
</font> 2010-07-02        Joel Sherrill <joel.sherrill@oarcorp.com>
 
        * psx13/test.c: Fix warning.

<font color='#006600'>diff -u rtems/testsuites/psxtests/psxid01/init.c:1.1 rtems/testsuites/psxtests/psxid01/init.c:1.2
--- rtems/testsuites/psxtests/psxid01/init.c:1.1        Thu Jul  1 09:40:14 2010
+++ rtems/testsuites/psxtests/psxid01/init.c    Mon Jul  5 16:32:47 2010
</font><font color='#997700'>@@ -90,6 +90,33 @@
</font> 
   sc = issetugid();
   rtems_test_assert( sc == 0 );
<font color='#000088'>+
+  puts( "getpgrp - return local node - OK" );
+  pid = getpgrp();
+  printf( "getpgrp returned %d\n", pid );<span style="background-color: #FF0000"> </span>
+
+  puts( "getgroups - return 0 - OK" );
+  sc = getgroups( 0, NULL );
+  rtems_test_assert( sc == 0 );
+<span style="background-color: #FF0000">  </span>
+}
+
+void test_getlogin(void)
+{
+  int sc;
+  char ch;
+
+  printf( "getlogin() -- %s\n", getlogin() );
+
+  puts( "getlogin_r(NULL, LOGIN_NAME_MAX) -- EFAULT" );
+  sc = getlogin_r( NULL, LOGIN_NAME_MAX );
+  rtems_test_assert( sc == EFAULT );
+
+  puts( "getlogin_r(buffer, 0) -- ERANGE" );
+  sc = getlogin_r( &ch, 0 );
+  rtems_test_assert( sc == ERANGE );
+
+<span style="background-color: #FF0000">  </span>
</font> }
 
 rtems_task Init(
<font color='#997700'>@@ -107,6 +134,8 @@
</font>   test_pid();
   puts( "" );
 
<font color='#000088'>+  test_getlogin();
+
</font>   puts( "*** END OF TEST ID 01 ***" );
 
   rtems_test_exit(0);

<font color='#006600'>diff -u rtems/testsuites/psxtests/psxid01/psxid01.doc:1.1 rtems/testsuites/psxtests/psxid01/psxid01.doc:1.2
--- rtems/testsuites/psxtests/psxid01/psxid01.doc:1.1   Thu Jul  1 09:40:14 2010
+++ rtems/testsuites/psxtests/psxid01/psxid01.doc       Mon Jul  5 16:32:47 2010
</font><font color='#997700'>@@ -28,6 +28,10 @@
</font>   __getpid
   getppid
   setsid
<font color='#000088'>+  getpgrp
+  getgroups
+  getlogin
+  getlogin_r
</font> 
 concepts:
 

<font color='#006600'>diff -u rtems/testsuites/psxtests/psxid01/psxid01.scn:1.1 rtems/testsuites/psxtests/psxid01/psxid01.scn:1.2
--- rtems/testsuites/psxtests/psxid01/psxid01.scn:1.1   Thu Jul  1 09:40:14 2010
+++ rtems/testsuites/psxtests/psxid01/psxid01.scn       Mon Jul  5 16:32:48 2010
</font><font color='#997700'>@@ -16,5 +16,11 @@
</font> __getpid = 1
 getppid = 0
 setsid - EPERM
<font color='#000088'>+getpgrp - return local node - OK
+getpgrp returned 1
+getgroups - return 0 - OK
</font> 
<font color='#000088'>+getlogin() --<span style="background-color: #FF0000"> </span>
+getlogin_r(NULL, LOGIN_NAME_MAX) -- EFAULT
+getlogin_r(buffer, 0) -- ERANGE
</font> *** END OF TEST ID 01 ***
</pre>
<p> </p>
<a name='cs4'></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-07-05 Joel Sherrill <joel.sherrill@oarcorp.com>

        * psxid01/init.c, psxid01/psxid01.scn: Actually match an entry in
        /etc/passwd and /etc/group.
</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.284&r2=text&tr2=1.285&diff_format=h">M</a></td><td width='1%'>1.285</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/psxid01/init.c.diff?r1=text&tr1=1.2&r2=text&tr2=1.3&diff_format=h">M</a></td><td width='1%'>1.3</td><td width='100%'>testsuites/psxtests/psxid01/init.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxid01/psxid01.scn.diff?r1=text&tr1=1.2&r2=text&tr2=1.3&diff_format=h">M</a></td><td width='1%'>1.3</td><td width='100%'>testsuites/psxtests/psxid01/psxid01.scn</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtests/ChangeLog:1.284 rtems/testsuites/psxtests/ChangeLog:1.285
--- rtems/testsuites/psxtests/ChangeLog:1.284   Mon Jul  5 16:32:46 2010
+++ rtems/testsuites/psxtests/ChangeLog Mon Jul  5 17:01:05 2010
</font><font color='#997700'>@@ -1,5 +1,10 @@
</font> 2010-07-05        Joel Sherrill <joel.sherrill@oarcorp.com>
 
<font color='#000088'>+   * psxid01/init.c, psxid01/psxid01.scn: Actually match an entry in
+       /etc/passwd and /etc/group.
+
+2010-07-05     Joel Sherrill <joel.sherrill@oarcorp.com>
+
</font>   * psxid01/init.c, psxid01/psxid01.doc, psxid01/psxid01.scn: Add test
        cases.
 

<font color='#006600'>diff -u rtems/testsuites/psxtests/psxid01/init.c:1.2 rtems/testsuites/psxtests/psxid01/init.c:1.3
--- rtems/testsuites/psxtests/psxid01/init.c:1.2        Mon Jul  5 16:32:47 2010
+++ rtems/testsuites/psxtests/psxid01/init.c    Mon Jul  5 17:01:06 2010
</font><font color='#997700'>@@ -106,7 +106,15 @@
</font>   int sc;
   char ch;
 
<font color='#880000'>-  printf( "getlogin() -- %s\n", getlogin() );
</font><font color='#000088'>+  puts( "setuid(5)" );
+  sc = setuid(5);
+  rtems_test_assert( sc == 0 );
+  printf( "getlogin() -- (%s)\n", getlogin() );
+
+  puts( "setuid(0)" );
+  sc = setuid(0);
+  rtems_test_assert( sc == 0 );
+  printf( "getlogin() -- (%s)\n", getlogin() );
</font> 
   puts( "getlogin_r(NULL, LOGIN_NAME_MAX) -- EFAULT" );
   sc = getlogin_r( NULL, LOGIN_NAME_MAX );
<font color='#997700'>@@ -146,7 +154,9 @@
</font> #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
 
<font color='#880000'>-#define CONFIGURE_MAXIMUM_TASKS             1
</font><font color='#000088'>+#define CONFIGURE_MAXIMUM_TASKS                  1
+/* so we can write /etc/passwd and /etc/group */
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
</font> #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
 #define CONFIGURE_INIT

<font color='#006600'>diff -u rtems/testsuites/psxtests/psxid01/psxid01.scn:1.2 rtems/testsuites/psxtests/psxid01/psxid01.scn:1.3
--- rtems/testsuites/psxtests/psxid01/psxid01.scn:1.2   Mon Jul  5 16:32:48 2010
+++ rtems/testsuites/psxtests/psxid01/psxid01.scn       Mon Jul  5 17:01:06 2010
</font><font color='#997700'>@@ -20,7 +20,10 @@
</font> getpgrp returned 1
 getgroups - return 0 - OK
 
<font color='#880000'>-getlogin() --<span style="background-color: #FF0000"> </span>
</font><font color='#000088'>+setuid(5)
+getlogin() -- ()
+setuid(0)
+getlogin() -- (root)
</font> getlogin_r(NULL, LOGIN_NAME_MAX) -- EFAULT
 getlogin_r(buffer, 0) -- ERANGE
 *** END OF TEST ID 01 ***
</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>