- if ((master_in = posix_openpt(O_RDWR | O_NOCTTY)) < 0) {
- die("Unable to open master pseudo-tty: %s\n", strerror(errno));
- }
-
- if ((master_out = posix_openpt(O_RDWR | O_NOCTTY)) < 0) {
- die("Unable to open master pseudo-tty: %s\n", strerror(errno));
- }
-
- if (grantpt(master_in) < 0) {
- die("Unable to grant permissions to master pty: %s\n",
- strerror(errno));
- }
-
- if (grantpt(master_out) < 0) {
- die("Unable to grant permissions to master pty: %s\n",
- strerror(errno));
- }
-
- if (unlockpt(master_in) < 0) {
- die("Unable to unlock master pty: %s\n", strerror(errno));
- }
-
- if (unlockpt(master_out) < 0) {
- die("Unable to unlock master pty: %s\n", strerror(errno));
- }