* opentty(): Added missing return in error case. Fixed warning.

* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36140 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2010-04-11 09:59:59 +00:00
parent ad0b28334d
commit de0b831289
+4 -5
View File
@@ -29,13 +29,12 @@ openpty(int* _master, int* _slave, char* name, struct termios* termAttrs,
return -1; return -1;
} }
if (termAttrs != NULL && tcsetattr(master, TCSANOW, termAttrs) != 0 if ((termAttrs != NULL && tcsetattr(master, TCSANOW, termAttrs) != 0)
|| windowSize != NULL || (windowSize != NULL
&& ioctl(master, TIOCSWINSZ, windowSize, sizeof(winsize)) != 0) { && ioctl(master, TIOCSWINSZ, windowSize, sizeof(winsize)) != 0)) {
// TODO we should either close master and slaves and return -1
// or we do nothing!
close(slave); close(slave);
close(master); close(master);
return -1;
} }
*_master = master; *_master = master;