Automatic whitespace cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35583 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2010-02-23 13:45:28 +00:00
parent 21d9331efa
commit 035edd562b
+23 -23
View File
@@ -2,7 +2,7 @@
* Copyright 2007-2009, Haiku, Inc. All rights reserved. * Copyright 2007-2009, Haiku, Inc. All rights reserved.
* Copyright (c) 2003-4 Kian Duffy <[email protected]> * Copyright (c) 2003-4 Kian Duffy <[email protected]>
* Copyright (c) 2004 Daniel Furrer <[email protected]> * Copyright (c) 2004 Daniel Furrer <[email protected]>
* Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
* *
* Distributed under the terms of the MIT license. * Distributed under the terms of the MIT license.
* *
@@ -31,7 +31,7 @@
#include "TermConst.h" #include "TermConst.h"
#include "TermParse.h" #include "TermParse.h"
#include "TerminalBuffer.h" #include "TerminalBuffer.h"
#ifndef CEOF #ifndef CEOF
#define CEOF ('D'&037) #define CEOF ('D'&037)
@@ -95,7 +95,7 @@ setenv(const char *var, const char *value, bool overwrite)
/* handshake interface */ /* handshake interface */
typedef struct typedef struct
{ {
int status; /* status of child */ int status; /* status of child */
char msg[128]; /* error message */ char msg[128]; /* error message */
@@ -138,9 +138,9 @@ Shell::Open(int row, int col, const char *encoding, int argc, const char **argv)
fTermParse = new (std::nothrow) TermParse(fFd); fTermParse = new (std::nothrow) TermParse(fFd);
if (fTermParse == NULL) { if (fTermParse == NULL) {
Close(); Close();
return B_NO_MEMORY; return B_NO_MEMORY;
} }
return B_OK; return B_OK;
} }
@@ -150,14 +150,14 @@ Shell::Close()
{ {
delete fTermParse; delete fTermParse;
fTermParse = NULL; fTermParse = NULL;
if (fFd >= 0) { if (fFd >= 0) {
close(fFd); close(fFd);
kill(-fProcessID, SIGHUP); kill(-fProcessID, SIGHUP);
fProcessID = -1; fProcessID = -1;
int status; int status;
wait(&status); wait(&status);
fFd = -1; fFd = -1;
} }
} }
@@ -174,7 +174,7 @@ Shell::Read(void *buffer, size_t numBytes) const
{ {
if (fFd < 0) if (fFd < 0)
return B_NO_INIT; return B_NO_INIT;
return read(fFd, buffer, numBytes); return read(fFd, buffer, numBytes);
} }
@@ -184,7 +184,7 @@ Shell::Write(const void *buffer, size_t numBytes)
{ {
if (fFd < 0) if (fFd < 0)
return B_NO_INIT; return B_NO_INIT;
return write(fFd, buffer, numBytes); return write(fFd, buffer, numBytes);
} }
@@ -233,7 +233,7 @@ Shell::AttachBuffer(TerminalBuffer *buffer)
return B_ERROR; return B_ERROR;
fAttached = true; fAttached = true;
return fTermParse->StartThreads(buffer); return fTermParse->StartThreads(buffer);
} }
@@ -270,7 +270,7 @@ initialize_termios(struct termios &tio)
*/ */
tio.c_line = 0; tio.c_line = 0;
tio.c_lflag |= ECHOE; tio.c_lflag |= ECHOE;
/* input: nl->nl, cr->nl */ /* input: nl->nl, cr->nl */
tio.c_iflag &= ~(INLCR|IGNCR); tio.c_iflag &= ~(INLCR|IGNCR);
@@ -320,14 +320,14 @@ status_t
Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **argv) Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **argv)
{ {
const char *kDefaultShellCommand[] = { "/bin/sh", "--login", NULL }; const char *kDefaultShellCommand[] = { "/bin/sh", "--login", NULL };
if (argv == NULL || argc == 0) { if (argv == NULL || argc == 0) {
argv = kDefaultShellCommand; argv = kDefaultShellCommand;
argc = 2; argc = 2;
} }
signal(SIGTTOU, SIG_IGN); signal(SIGTTOU, SIG_IGN);
#ifdef __HAIKU__ #ifdef __HAIKU__
// get a pseudo-tty // get a pseudo-tty
int master = posix_openpt(O_RDWR | O_NOCTTY); int master = posix_openpt(O_RDWR | O_NOCTTY);
@@ -339,11 +339,11 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
* which is already in use, so we simply go until the open succeeds. * which is already in use, so we simply go until the open succeeds.
*/ */
char ttyName[B_PATH_NAME_LENGTH]; char ttyName[B_PATH_NAME_LENGTH];
int master = -1; int master = -1;
DIR *dir = opendir("/dev/pt/"); DIR *dir = opendir("/dev/pt/");
if (dir != NULL) { if (dir != NULL) {
struct dirent *dirEntry; struct dirent *dirEntry;
while ((dirEntry = readdir(dir)) != NULL) { while ((dirEntry = readdir(dir)) != NULL) {
// skip '.' and '..' // skip '.' and '..'
if (dirEntry->d_name[0] == '.') if (dirEntry->d_name[0] == '.')
continue; continue;
@@ -358,7 +358,7 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
break; break;
} else { } else {
// B_BUSY is a normal case // B_BUSY is a normal case
if (errno != B_BUSY) if (errno != B_BUSY)
fprintf(stderr, "could not open %s: %s\n", ptyName, strerror(errno)); fprintf(stderr, "could not open %s: %s\n", ptyName, strerror(errno));
} }
} }
@@ -435,11 +435,11 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
* TODO: so why are we doing it ? * TODO: so why are we doing it ?
*/ */
tcgetattr(slave, &tio); tcgetattr(slave, &tio);
initialize_termios(tio); initialize_termios(tio);
/* /*
* change control tty. * change control tty.
*/ */
dup2(slave, 0); dup2(slave, 0);
@@ -506,7 +506,7 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
* Exec failed. * Exec failed.
* TODO: This doesn't belong here. * TODO: This doesn't belong here.
*/ */
sleep(1); sleep(1);
const char *spawnAlertMessage = "alert --stop " const char *spawnAlertMessage = "alert --stop "
"'Cannot execute \"%s\":\n" "'Cannot execute \"%s\":\n"
@@ -524,7 +524,7 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
} }
/* /*
* In parent Process, Set up the input and output file pointers so * In parent Process, Set up the input and output file pointers so
* that they can write and read the pseudo terminal. * that they can write and read the pseudo terminal.
*/ */
@@ -554,7 +554,7 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
break; break;
} }
} }
if (done <= 0) if (done <= 0)
return B_ERROR; return B_ERROR;