diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-08-28 13:00:29 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-08-28 13:00:29 +0200 |
commit | cc272b06eefb87030bb85b686abdbc22b5ed1c34 (patch) | |
tree | 06024199184cfab43807a1fdcc2a240b9cf5ac99 /libbb/getpty.c | |
parent | d84b175cb6948eb17f847313bf912174e2f934e1 (diff) | |
download | busybox-w32-1_19_1.tar.gz busybox-w32-1_19_1.tar.bz2 busybox-w32-1_19_1.zip |
Apply post-1.19.0 patches, bump version to 1.19.11_19_1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to '')
-rw-r--r-- | libbb/getpty.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libbb/getpty.c b/libbb/getpty.c index 6a15cff2f..435e4d09f 100644 --- a/libbb/getpty.c +++ b/libbb/getpty.c | |||
@@ -19,20 +19,22 @@ int FAST_FUNC xgetpty(char *line) | |||
19 | if (p > 0) { | 19 | if (p > 0) { |
20 | grantpt(p); /* chmod+chown corresponding slave pty */ | 20 | grantpt(p); /* chmod+chown corresponding slave pty */ |
21 | unlockpt(p); /* (what does this do?) */ | 21 | unlockpt(p); /* (what does this do?) */ |
22 | #ifndef HAVE_PTSNAME_R | 22 | # ifndef HAVE_PTSNAME_R |
23 | const char *name; | 23 | { |
24 | name = ptsname(p); /* find out the name of slave pty */ | 24 | const char *name; |
25 | if (!name) { | 25 | name = ptsname(p); /* find out the name of slave pty */ |
26 | bb_perror_msg_and_die("ptsname error (is /dev/pts mounted?)"); | 26 | if (!name) { |
27 | bb_perror_msg_and_die("ptsname error (is /dev/pts mounted?)"); | ||
28 | } | ||
29 | safe_strncpy(line, name, GETPTY_BUFSIZE); | ||
27 | } | 30 | } |
28 | safe_strncpy(line, name, GETPTY_BUFSIZE); | 31 | # else |
29 | #else | ||
30 | /* find out the name of slave pty */ | 32 | /* find out the name of slave pty */ |
31 | if (ptsname_r(p, line, GETPTY_BUFSIZE-1) != 0) { | 33 | if (ptsname_r(p, line, GETPTY_BUFSIZE-1) != 0) { |
32 | bb_perror_msg_and_die("ptsname error (is /dev/pts mounted?)"); | 34 | bb_perror_msg_and_die("ptsname error (is /dev/pts mounted?)"); |
33 | } | 35 | } |
34 | line[GETPTY_BUFSIZE-1] = '\0'; | 36 | line[GETPTY_BUFSIZE-1] = '\0'; |
35 | #endif | 37 | # endif |
36 | return p; | 38 | return p; |
37 | } | 39 | } |
38 | #else | 40 | #else |