Tidy up some loose ends. nullfs_read/write were returning the wrong value.

Fix some ctype problems - isascii() caused a warning if fed an unsigned
char - it's always > 0 and libstand is compiled with -Wall.
Missing prototype/include in printf.c
This commit is contained in:
Peter Wemm 1999-12-27 08:45:14 +00:00
parent 0ba6f08f0a
commit 59e1f32482
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55137
3 changed files with 7 additions and 5 deletions

View File

@ -1,3 +1,4 @@
/* $FreeBSD$ */
/* $NetBSD: nullfs.c,v 1.1 1996/01/13 22:25:39 leo Exp $ */
/*-
@ -80,13 +81,13 @@ int null_close(struct open_file *f)
return 0;
}
ssize_t null_read (struct open_file *f, void *buf, size_t size, size_t *resid)
int null_read (struct open_file *f, void *buf, size_t size, size_t *resid)
{
errno = EIO;
return -1;
}
ssize_t null_write (struct open_file *f, void *buf, size_t size, size_t *resid)
int null_write (struct open_file *f, void *buf, size_t size, size_t *resid)
{
errno = EIO;
return -1;

View File

@ -44,6 +44,7 @@
*/
#include <sys/types.h>
#include <string.h>
#include "stand.h"
/*

View File

@ -165,7 +165,7 @@ extern struct open_file files[];
#define isspace(c) ((c) == ' ' || ((c) >= 0x9 && (c) <= 0xd))
#define isdigit(c) ((c) >= '0' && (c) <= '9')
#define isxdigit(c) (isdigit(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
#define isascii(c) ((c) >= 0 || (c <= 0x7f))
#define isascii(c) (((unsigned char)c) <= 0x7f)
#define isalpha(c) (isupper(c) || (islower(c)))
static __inline int toupper(int c)
@ -307,8 +307,8 @@ extern void nullsys(void);
extern int null_open(const char *path, struct open_file *f);
extern int null_close(struct open_file *f);
extern ssize_t null_read(struct open_file *f, void *buf, size_t size, size_t *resid);
extern ssize_t null_write(struct open_file *f, void *buf, size_t size, size_t *resid);
extern int null_read(struct open_file *f, void *buf, size_t size, size_t *resid);
extern int null_write(struct open_file *f, void *buf, size_t size, size_t *resid);
extern off_t null_seek(struct open_file *f, off_t offset, int where);
extern int null_stat(struct open_file *f, struct stat *sb);