Made things compile under SunOS4 again.
Fix lots of warnings under SunOS4. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1201 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -55,7 +55,7 @@ RCSID("$Id$");
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#if defined(HAVE_SYS_IOCTL_H) && SunOS != 4
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
|
@@ -49,11 +49,9 @@ void utmp_login(char *tty, char *username, char *hostname) { return; }
|
||||
void utmp_login(char *tty, char *username, char *hostname)
|
||||
{
|
||||
struct utmp utmp;
|
||||
struct hostent *he;
|
||||
int fd;
|
||||
|
||||
char *ttyx; /* tty w/o /dev/* */
|
||||
char *id;
|
||||
|
||||
ttyx = tty;
|
||||
|
||||
@@ -71,6 +69,7 @@ void utmp_login(char *tty, char *username, char *hostname)
|
||||
|
||||
# ifdef HAVE_UT_ADDR
|
||||
if (hostname[0]) {
|
||||
struct hostent *he;
|
||||
if ((he = gethostbyname(hostname)))
|
||||
memcpy(&utmp.ut_addr, he->h_addr_list[0],
|
||||
sizeof(utmp.ut_addr));
|
||||
@@ -90,11 +89,13 @@ void utmp_login(char *tty, char *username, char *hostname)
|
||||
# endif
|
||||
|
||||
# ifdef HAVE_UT_ID
|
||||
/* any particular reason to not include "tty" ? */
|
||||
id = ttyx;
|
||||
if(strncmp(ttyx, "tty", 3) == 0)
|
||||
{
|
||||
/* any particular reason to not include "tty" ? */
|
||||
char *id = ttyx;
|
||||
if(strncmp(ttyx, "tty", 3) == 0)
|
||||
id += 3;
|
||||
strncpy(utmp.ut_id, id, sizeof(utmp.ut_id));
|
||||
strncpy(utmp.ut_id, id, sizeof(utmp.ut_id));
|
||||
}
|
||||
# endif
|
||||
|
||||
|
||||
|
@@ -55,7 +55,7 @@ RCSID("$Id$");
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#if defined(HAVE_SYS_IOCTL_H) && SunOS != 4
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
|
@@ -65,7 +65,7 @@
|
||||
#include <termios.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#if defined(HAVE_SYS_IOCTL_H) && SunOS != 4
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
@@ -99,6 +99,10 @@ char * strlwr(char *);
|
||||
int strnlen(char*, int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRTOK_R
|
||||
char *strtok_r(char *s1, const char *s2, char **lasts);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRUPR
|
||||
char * strupr(char *);
|
||||
#endif
|
||||
|
@@ -65,7 +65,7 @@
|
||||
#include <termios.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#if defined(HAVE_SYS_IOCTL_H) && SunOS != 4
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
@@ -99,6 +99,10 @@ char * strlwr(char *);
|
||||
int strnlen(char*, int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRTOK_R
|
||||
char *strtok_r(char *s1, const char *s2, char **lasts);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRUPR
|
||||
char * strupr(char *);
|
||||
#endif
|
||||
|
@@ -41,8 +41,9 @@
|
||||
RCSID("$Id$");
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
extern int sys_nerr;
|
||||
extern char *sys_errlist[];
|
||||
|
@@ -43,6 +43,8 @@ RCSID("$Id$");
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "roken.h"
|
||||
|
||||
char *
|
||||
strtok_r(char *s1, const char *s2, char **lasts)
|
||||
{
|
||||
|
@@ -135,7 +135,7 @@ sl_loop (SL_cmd *cmds, char *prompt)
|
||||
ptr = malloc(max_count * sizeof(*ptr));
|
||||
if (ptr == NULL) {
|
||||
printf ("sl_loop: failed to allocate %u bytes of memory\n",
|
||||
max_count * sizeof(*ptr));
|
||||
(int) max_count * sizeof(*ptr));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ sl_loop (SL_cmd *cmds, char *prompt)
|
||||
if (ptr == NULL) {
|
||||
printf ("sl_loop: failed to allocate %u "
|
||||
"bytes of memory\n",
|
||||
max_count * sizeof(*ptr));
|
||||
(int) max_count * sizeof(*ptr));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user