Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Unified Diff: fusl/src/misc/login_tty.c

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: fusl/src/misc/login_tty.c
diff --git a/fusl/src/misc/login_tty.c b/fusl/src/misc/login_tty.c
index f0be0a09a35533519dbdf4a65c76a895c3ce34e5..5022e60fa1b9a48c4c24f7036b6fce103be133cc 100644
--- a/fusl/src/misc/login_tty.c
+++ b/fusl/src/misc/login_tty.c
@@ -2,13 +2,14 @@
#include <sys/ioctl.h>
#include <unistd.h>
-int login_tty(int fd)
-{
- setsid();
- if (ioctl(fd, TIOCSCTTY, (char *)0)) return -1;
- dup2(fd, 0);
- dup2(fd, 1);
- dup2(fd, 2);
- if (fd>2) close(fd);
- return 0;
+int login_tty(int fd) {
+ setsid();
+ if (ioctl(fd, TIOCSCTTY, (char*)0))
+ return -1;
+ dup2(fd, 0);
+ dup2(fd, 1);
+ dup2(fd, 2);
+ if (fd > 2)
+ close(fd);
+ return 0;
}

Powered by Google App Engine
This is Rietveld 408576698