diff options
author | 2001-12-19 07:18:56 +0000 | |
---|---|---|
committer | 2001-12-19 07:18:56 +0000 | |
commit | 660b1623ac34469dd86eaf69a3bccd2a8642bb90 (patch) | |
tree | 5ba7846ddd7874585d9bc2e7332ee4b225377280 /usr.bin/ssh/sshpty.c | |
parent | Introduce brdtyp and change what cputyp means. (diff) | |
download | wireguard-openbsd-660b1623ac34469dd86eaf69a3bccd2a8642bb90.tar.xz wireguard-openbsd-660b1623ac34469dd86eaf69a3bccd2a8642bb90.zip |
basic KNF done while i was looking for something else
Diffstat (limited to 'usr.bin/ssh/sshpty.c')
-rw-r--r-- | usr.bin/ssh/sshpty.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/usr.bin/ssh/sshpty.c b/usr.bin/ssh/sshpty.c index ef47fe4394c..b21d3cc1769 100644 --- a/usr.bin/ssh/sshpty.c +++ b/usr.bin/ssh/sshpty.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshpty.c,v 1.3 2001/07/22 21:32:27 markus Exp $"); +RCSID("$OpenBSD: sshpty.c,v 1.4 2001/12/19 07:18:56 deraadt Exp $"); #include <util.h> #include "sshpty.h" @@ -131,7 +131,7 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) *ttyfd = open(name, O_RDWR | O_NOCTTY); if (*ttyfd < 0) { error("Could not open pty slave side %.100s: %.100s", - name, strerror(errno)); + name, strerror(errno)); close(*ptyfd); return 0; } @@ -224,7 +224,7 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname) fd = open(_PATH_TTY, O_WRONLY); if (fd < 0) error("open /dev/tty failed - could not set controlling tty: %.100s", - strerror(errno)); + strerror(errno)); else { close(fd); } @@ -234,7 +234,7 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname) void pty_change_window_size(int ptyfd, int row, int col, - int xpixel, int ypixel) + int xpixel, int ypixel) { struct winsize w; w.ws_row = row; @@ -273,15 +273,15 @@ pty_setowner(struct passwd *pw, const char *ttyname) if (st.st_uid != pw->pw_uid || st.st_gid != gid) { if (chown(ttyname, pw->pw_uid, gid) < 0) { - if (errno == EROFS && + if (errno == EROFS && (st.st_uid == pw->pw_uid || st.st_uid == 0)) error("chown(%.100s, %d, %d) failed: %.100s", - ttyname, pw->pw_uid, gid, - strerror(errno)); + ttyname, pw->pw_uid, gid, + strerror(errno)); else fatal("chown(%.100s, %d, %d) failed: %.100s", - ttyname, pw->pw_uid, gid, - strerror(errno)); + ttyname, pw->pw_uid, gid, + strerror(errno)); } } @@ -290,10 +290,10 @@ pty_setowner(struct passwd *pw, const char *ttyname) if (errno == EROFS && (st.st_mode & (S_IRGRP | S_IROTH)) == 0) error("chmod(%.100s, 0%o) failed: %.100s", - ttyname, mode, strerror(errno)); + ttyname, mode, strerror(errno)); else fatal("chmod(%.100s, 0%o) failed: %.100s", - ttyname, mode, strerror(errno)); + ttyname, mode, strerror(errno)); } } } |