diff options
Diffstat (limited to 'libbb/getpty.c')
-rw-r--r-- | libbb/getpty.c | 8 |
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 @@ | |||
10 | 10 | ||
11 | #define DEBUG 0 | 11 | #define DEBUG 0 |
12 | 12 | ||
13 | int getpty(char *line) | 13 | int xgetpty(char *line) |
14 | { | 14 | { |
15 | int p; | 15 | int p; |
16 | #if ENABLE_FEATURE_DEVPTS | 16 | #if ENABLE_FEATURE_DEVPTS |
@@ -22,7 +22,7 @@ int getpty(char *line) | |||
22 | name = ptsname(p); | 22 | name = ptsname(p); |
23 | if (!name) { | 23 | if (!name) { |
24 | bb_perror_msg("ptsname error (is /dev/pts mounted?)"); | 24 | bb_perror_msg("ptsname error (is /dev/pts mounted?)"); |
25 | return -1; | 25 | goto fail; |
26 | } | 26 | } |
27 | safe_strncpy(line, name, GETPTY_BUFSIZE); | 27 | safe_strncpy(line, name, GETPTY_BUFSIZE); |
28 | return p; | 28 | return p; |
@@ -52,7 +52,9 @@ int getpty(char *line) | |||
52 | } | 52 | } |
53 | } | 53 | } |
54 | #endif /* FEATURE_DEVPTS */ | 54 | #endif /* FEATURE_DEVPTS */ |
55 | return -1; | 55 | USE_FEATURE_DEVPTS( fail:) |
56 | bb_error_msg_and_die("open pty"); | ||
57 | return -1; /* never get here */ | ||
56 | } | 58 | } |
57 | 59 | ||
58 | 60 | ||