Fixed compilation with local changes (to be commited later).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5263 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
** Distributed under the terms of the OpenBeOS License.
|
||||
*/
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
@@ -15,23 +18,20 @@
|
||||
#define DEV_TTY "/dev/tt/"
|
||||
|
||||
|
||||
/*
|
||||
* ttyname - return the full pathname of the tty device
|
||||
* (NULL if not a tty or an error occurs)
|
||||
/** return the full pathname of the tty device
|
||||
* (NULL if not a tty or an error occurs)
|
||||
*/
|
||||
|
||||
char *
|
||||
ttyname (int fd)
|
||||
ttyname(int fd)
|
||||
{
|
||||
static char pathname[MAXPATHLEN];
|
||||
|
||||
char *stub = pathname + sizeof(DEV_TTY) - 1;
|
||||
int stubLen = sizeof(pathname) - sizeof(DEV_TTY);
|
||||
|
||||
struct stat fdStat;
|
||||
DIR *dir;
|
||||
bool found = false;
|
||||
|
||||
|
||||
// first, some sanity checks:
|
||||
if (!isatty(fd))
|
||||
return NULL;
|
||||
@@ -42,7 +42,6 @@ ttyname (int fd)
|
||||
if (!S_ISCHR(fdStat.st_mode))
|
||||
return NULL;
|
||||
|
||||
|
||||
// start with the root tty directory at /dev
|
||||
strcpy(pathname, DEV_TTY);
|
||||
|
||||
@@ -50,7 +49,6 @@ ttyname (int fd)
|
||||
// find a matching entry in the directory:
|
||||
// we must match both the inode for the file
|
||||
// and the device that the file resides on
|
||||
|
||||
struct dirent *e;
|
||||
struct stat entryStat;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user