forked from Imagelibrary/rtems
2010-03-11 Ken Peters <kptrs@yahoo.com>
PR 1456/cpukit * libcsupport/src/ttyname.c: ttyname_r() when called directly (not via ttyname()) does not prefix the caller provided buffer with the predefined _PATH_DEV string (/dev/). Thus the directory search fails and no tty name is returned to the caller.
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2010-03-11 Ken Peters <kptrs@yahoo.com>
|
||||||
|
|
||||||
|
PR 1456/cpukit
|
||||||
|
* libcsupport/src/ttyname.c: ttyname_r() when called directly (not via
|
||||||
|
ttyname()) does not prefix the caller provided buffer with the
|
||||||
|
predefined _PATH_DEV string (/dev/). Thus the directory search fails
|
||||||
|
and no tty name is returned to the caller.
|
||||||
|
|
||||||
2010-03-11 Joel Sherrill <joel.sherrill@oarcorp.com>
|
2010-03-11 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
* ftpd/ftpd.c, httpd/uemf.c, httpd/um.c, httpd/webs.c,
|
* ftpd/ftpd.c, httpd/uemf.c, httpd/um.c, httpd/webs.c,
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
#include <rtems/libio_.h>
|
#include <rtems/libio_.h>
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
|
|
||||||
static char ttyname_buf[sizeof (_PATH_DEV) + MAXNAMLEN] = _PATH_DEV;
|
static char ttyname_buf[sizeof (_PATH_DEV) + MAXNAMLEN];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ttyname_r() - POSIX 1003.1b 4.7.2 - Demetermine Terminal Device Name
|
* ttyname_r() - POSIX 1003.1b 4.7.2 - Demetermine Terminal Device Name
|
||||||
@@ -84,6 +84,9 @@ int ttyname_r(
|
|||||||
if ((dp = opendir (_PATH_DEV)) == NULL)
|
if ((dp = opendir (_PATH_DEV)) == NULL)
|
||||||
rtems_set_errno_and_return_minus_one(EBADF);
|
rtems_set_errno_and_return_minus_one(EBADF);
|
||||||
|
|
||||||
|
/* Place the base directory in the path. */
|
||||||
|
strncpy (name, _PATH_DEV, namesize);
|
||||||
|
|
||||||
for (rval = NULL; (dirp = readdir (dp)) != NULL ;)
|
for (rval = NULL; (dirp = readdir (dp)) != NULL ;)
|
||||||
{
|
{
|
||||||
if (dirp->d_ino != sb.st_ino)
|
if (dirp->d_ino != sb.st_ino)
|
||||||
|
|||||||
Reference in New Issue
Block a user