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