WARNS=2 cleanup.

PR:		bin/32567
MFC after:	2 weeks
This commit is contained in:
Mike Heffner 2001-12-09 07:22:26 +00:00
parent ffb6d5ad8f
commit 87e5cd7c1a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87551
3 changed files with 16 additions and 3 deletions

View File

@ -4,4 +4,6 @@ PROG= kldxref
SRCS= kldxref.c ef.c
MAN= kldxref.8
WARNS?= 2
.include <bsd.prog.mk>

View File

@ -49,6 +49,10 @@
#include "ef.h"
static void ef_print_phdr(Elf_Phdr *);
static u_long ef_get_offset(elf_file_t, Elf_Off);
static int ef_parse_dynamic(elf_file_t);
void
ef_print_phdr(Elf_Phdr *phdr)
{
@ -213,12 +217,18 @@ ef_parse_dynamic(elf_file_t ef)
int
ef_read(elf_file_t ef, Elf_Off offset, size_t len, void*dest)
{
ssize_t r;
if (offset != -1) {
if (offset != (Elf_Off)-1) {
if (lseek(ef->ef_fd, offset, SEEK_SET) == -1)
return EIO;
}
return read(ef->ef_fd, dest, len) == len ? 0 : EIO;
r = read(ef->ef_fd, dest, len);
if (r != -1 && (size_t)r == len)
return 0;
else
return EIO;
}
int

View File

@ -81,11 +81,12 @@ static int dflag, verbose;
FILE *fxref;
static char *xref_file = "linker.hints";
static const char *xref_file = "linker.hints";
static char recbuf[MAXRECSIZE];
static int recpos, reccnt;
void maketempfile(char *, const char *);
static void usage(void);
static void