version 1.3.2.1, 2002/03/07 17:37:48 |
version 1.3.2.2, 2002/06/26 18:22:37 |
|
|
if (fd < 0) |
if (fd < 0) |
error("open /dev/tty failed - could not set controlling tty: %.100s", |
error("open /dev/tty failed - could not set controlling tty: %.100s", |
strerror(errno)); |
strerror(errno)); |
else { |
else |
close(fd); |
close(fd); |
} |
|
} |
} |
|
|
/* Changes the window size associated with the pty. */ |
/* Changes the window size associated with the pty. */ |
|
|
int xpixel, int ypixel) |
int xpixel, int ypixel) |
{ |
{ |
struct winsize w; |
struct winsize w; |
|
|
w.ws_row = row; |
w.ws_row = row; |
w.ws_col = col; |
w.ws_col = col; |
w.ws_xpixel = xpixel; |
w.ws_xpixel = xpixel; |
|
|
if (st.st_uid != pw->pw_uid || st.st_gid != gid) { |
if (st.st_uid != pw->pw_uid || st.st_gid != gid) { |
if (chown(ttyname, pw->pw_uid, gid) < 0) { |
if (chown(ttyname, pw->pw_uid, gid) < 0) { |
if (errno == EROFS && |
if (errno == EROFS && |
(st.st_uid == pw->pw_uid || st.st_uid == 0)) |
(st.st_uid == pw->pw_uid || st.st_uid == 0)) |
error("chown(%.100s, %d, %d) failed: %.100s", |
error("chown(%.100s, %u, %u) failed: %.100s", |
ttyname, pw->pw_uid, gid, |
ttyname, (u_int)pw->pw_uid, (u_int)gid, |
strerror(errno)); |
strerror(errno)); |
else |
else |
fatal("chown(%.100s, %d, %d) failed: %.100s", |
fatal("chown(%.100s, %u, %u) failed: %.100s", |
ttyname, pw->pw_uid, gid, |
ttyname, (u_int)pw->pw_uid, (u_int)gid, |
strerror(errno)); |
strerror(errno)); |
} |
} |
} |
} |