aboutsummaryrefslogtreecommitdiff
path: root/libbb/getpty.c
diff options
context:
space:
mode:
authorGravatar Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-05-19 08:18:50 +0000
committerGravatar Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-05-19 08:18:50 +0000
commitae4342ca3e30f7b11732ecda3ad15821e81bc314 (patch)
tree1878104940eac4649bc8add4d0b2893ab1cb0a94 /libbb/getpty.c
parentee56e013cfb6304f66129afee7978b0864699419 (diff)
downloadbusybox-ae4342ca3e30f7b11732ecda3ad15821e81bc314.tar.gz
busybox-ae4342ca3e30f7b11732ecda3ad15821e81bc314.tar.bz2
- Rename getpty() to xgetpty() and adjust callers.
- Rewrite kbd_mode and setconsole - Introduce and use console_make_active() and xopen_xwrite_close() - honour buffer-reservation method as set by the user (dumpkmap, loadkmap) - shrink rtcwake and some console-tools Saves about 270 Bytes
Diffstat (limited to 'libbb/getpty.c')
-rw-r--r--libbb/getpty.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libbb/getpty.c b/libbb/getpty.c
index 5ac9582d3..d43fb825f 100644
--- a/libbb/getpty.c
+++ b/libbb/getpty.c
@@ -10,7 +10,7 @@
#define DEBUG 0
-int getpty(char *line)
+int xgetpty(char *line)
{
int p;
#if ENABLE_FEATURE_DEVPTS
@@ -22,7 +22,7 @@ int getpty(char *line)
name = ptsname(p);
if (!name) {
bb_perror_msg("ptsname error (is /dev/pts mounted?)");
- return -1;
+ goto fail;
}
safe_strncpy(line, name, GETPTY_BUFSIZE);
return p;
@@ -52,7 +52,9 @@ int getpty(char *line)
}
}
#endif /* FEATURE_DEVPTS */
- return -1;
+USE_FEATURE_DEVPTS( fail:)
+ bb_error_msg_and_die("open pty");
+ return -1; /* never get here */
}