Author: bonefish Date: 2010-02-23 14:45:28 +0100 (Tue, 23 Feb 2010) New Revision: 35583 Changeset: http://dev.haiku-os.org/changeset/35583/haiku Modified: haiku/trunk/src/apps/terminal/Shell.cpp Log: Automatic whitespace cleanup. Modified: haiku/trunk/src/apps/terminal/Shell.cpp =================================================================== --- haiku/trunk/src/apps/terminal/Shell.cpp 2010-02-23 13:43:43 UTC (rev 35582) +++ haiku/trunk/src/apps/terminal/Shell.cpp 2010-02-23 13:45:28 UTC (rev 35583) @@ -2,7 +2,7 @@ * Copyright 2007-2009, Haiku, Inc. All rights reserved. * Copyright (c) 2003-4 Kian Duffy <myob@xxxxxxxxxxxxxxxxxxxxx> * Copyright (c) 2004 Daniel Furrer <assimil8or@xxxxxxxxxxxxxxxxxxxxx> - * 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. * @@ -31,8 +31,8 @@ #include "TermConst.h" #include "TermParse.h" #include "TerminalBuffer.h" - + #ifndef CEOF #define CEOF ('D'&037) #endif @@ -95,7 +95,7 @@ /* handshake interface */ -typedef struct +typedef struct { int status; /* status of child */ char msg[128]; /* error message */ @@ -138,9 +138,9 @@ fTermParse = new (std::nothrow) TermParse(fFd); if (fTermParse == NULL) { Close(); - return B_NO_MEMORY; + return B_NO_MEMORY; } - + return B_OK; } @@ -150,14 +150,14 @@ { delete fTermParse; fTermParse = NULL; - + if (fFd >= 0) { close(fFd); kill(-fProcessID, SIGHUP); fProcessID = -1; int status; - wait(&status); - fFd = -1; + wait(&status); + fFd = -1; } } @@ -174,7 +174,7 @@ { if (fFd < 0) return B_NO_INIT; - + return read(fFd, buffer, numBytes); } @@ -184,7 +184,7 @@ { if (fFd < 0) return B_NO_INIT; - + return write(fFd, buffer, numBytes); } @@ -233,7 +233,7 @@ return B_ERROR; fAttached = true; - + return fTermParse->StartThreads(buffer); } @@ -270,7 +270,7 @@ */ tio.c_line = 0; - tio.c_lflag |= ECHOE; + tio.c_lflag |= ECHOE; /* input: nl->nl, cr->nl */ tio.c_iflag &= ~(INLCR|IGNCR); @@ -320,14 +320,14 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **argv) { const char *kDefaultShellCommand[] = { "/bin/sh", "--login", NULL }; - + if (argv == NULL || argc == 0) { argv = kDefaultShellCommand; - argc = 2; + argc = 2; } signal(SIGTTOU, SIG_IGN); - + #ifdef __HAIKU__ // get a pseudo-tty int master = posix_openpt(O_RDWR | O_NOCTTY); @@ -339,11 +339,11 @@ * which is already in use, so we simply go until the open succeeds. */ char ttyName[B_PATH_NAME_LENGTH]; - int master = -1; + int master = -1; DIR *dir = opendir("/dev/pt/"); if (dir != NULL) { struct dirent *dirEntry; - while ((dirEntry = readdir(dir)) != NULL) { + while ((dirEntry = readdir(dir)) != NULL) { // skip '.' and '..' if (dirEntry->d_name[0] == '.') continue; @@ -358,7 +358,7 @@ break; } else { // 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)); } } @@ -435,11 +435,11 @@ * TODO: so why are we doing it ? */ tcgetattr(slave, &tio); - + initialize_termios(tio); /* - * change control tty. + * change control tty. */ dup2(slave, 0); @@ -506,7 +506,7 @@ * Exec failed. * TODO: This doesn't belong here. */ - + sleep(1); const char *spawnAlertMessage = "alert --stop " "'Cannot execute \"%s\":\n" @@ -524,7 +524,7 @@ } /* - * 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. */ @@ -554,7 +554,7 @@ break; } } - + if (done <= 0) return B_ERROR;