if (p > 0) {
grantpt(p); /* chmod+chown corresponding slave pty */
unlockpt(p); /* (what does this do?) */
-#ifndef HAVE_PTSNAME_R
- const char *name;
- name = ptsname(p); /* find out the name of slave pty */
- if (!name) {
- bb_perror_msg_and_die("ptsname error (is /dev/pts mounted?)");
+# ifndef HAVE_PTSNAME_R
+ {
+ const char *name;
+ name = ptsname(p); /* find out the name of slave pty */
+ if (!name) {
+ bb_perror_msg_and_die("ptsname error (is /dev/pts mounted?)");
+ }
+ safe_strncpy(line, name, GETPTY_BUFSIZE);
}
- safe_strncpy(line, name, GETPTY_BUFSIZE);
-#else
+# else
/* find out the name of slave pty */
if (ptsname_r(p, line, GETPTY_BUFSIZE-1) != 0) {
bb_perror_msg_and_die("ptsname error (is /dev/pts mounted?)");
}
line[GETPTY_BUFSIZE-1] = '\0';
-#endif
+# endif
return p;
}
#else
* We don't check for errors here. Not supported == won't be used
*/
void FAST_FUNC
-socket_want_pktinfo(int fd)
+socket_want_pktinfo(int fd UNUSED_PARAM)
{
#ifdef IP_PKTINFO
setsockopt(fd, IPPROTO_IP, IP_PKTINFO, &const_int_1, sizeof(int));
while (match_status == 0) {
char *new = xasprintf("%s%.*s"HIGHLIGHT"%.*s"NORMAL,
growline ? growline : "",
- match_structs.rm_so, str,
- match_structs.rm_eo - match_structs.rm_so,
+ (int)match_structs.rm_so, str,
+ (int)(match_structs.rm_eo - match_structs.rm_so),
str + match_structs.rm_so);
free(growline);
growline = new;