diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-08-28 05:31:49 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-08-28 05:31:49 +0200 |
commit | 24915117a284c5536c9c707fc34ec9e7bf331f32 (patch) | |
tree | 2e9dd70792921647e31851667bbee13994dc6408 | |
parent | 1285437217a60194186b2c66a0422205b2dedd08 (diff) | |
download | busybox-w32-24915117a284c5536c9c707fc34ec9e7bf331f32.tar.gz busybox-w32-24915117a284c5536c9c707fc34ec9e7bf331f32.tar.bz2 busybox-w32-24915117a284c5536c9c707fc34ec9e7bf331f32.zip |
Fixes for warnings in FreeBSD build
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | libbb/getpty.c | 18 | ||||
-rw-r--r-- | libbb/udp_io.c | 2 | ||||
-rw-r--r-- | miscutils/less.c | 4 |
3 files changed, 13 insertions, 11 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 |
diff --git a/libbb/udp_io.c b/libbb/udp_io.c index b8fb6755d..7985a9723 100644 --- a/libbb/udp_io.c +++ b/libbb/udp_io.c | |||
@@ -13,7 +13,7 @@ | |||
13 | * We don't check for errors here. Not supported == won't be used | 13 | * We don't check for errors here. Not supported == won't be used |
14 | */ | 14 | */ |
15 | void FAST_FUNC | 15 | void FAST_FUNC |
16 | socket_want_pktinfo(int fd) | 16 | socket_want_pktinfo(int fd UNUSED_PARAM) |
17 | { | 17 | { |
18 | #ifdef IP_PKTINFO | 18 | #ifdef IP_PKTINFO |
19 | setsockopt(fd, IPPROTO_IP, IP_PKTINFO, &const_int_1, sizeof(int)); | 19 | setsockopt(fd, IPPROTO_IP, IP_PKTINFO, &const_int_1, sizeof(int)); |
diff --git a/miscutils/less.c b/miscutils/less.c index 2c6a79326..045fd2db3 100644 --- a/miscutils/less.c +++ b/miscutils/less.c | |||
@@ -721,8 +721,8 @@ static void print_found(const char *line) | |||
721 | while (match_status == 0) { | 721 | while (match_status == 0) { |
722 | char *new = xasprintf("%s%.*s"HIGHLIGHT"%.*s"NORMAL, | 722 | char *new = xasprintf("%s%.*s"HIGHLIGHT"%.*s"NORMAL, |
723 | growline ? growline : "", | 723 | growline ? growline : "", |
724 | match_structs.rm_so, str, | 724 | (int)match_structs.rm_so, str, |
725 | match_structs.rm_eo - match_structs.rm_so, | 725 | (int)(match_structs.rm_eo - match_structs.rm_so), |
726 | str + match_structs.rm_so); | 726 | str + match_structs.rm_so); |
727 | free(growline); | 727 | free(growline); |
728 | growline = new; | 728 | growline = new; |