diff options
| author | muffin <none@none> | 2005-10-20 11:47:44 -0700 |
|---|---|---|
| committer | muffin <none@none> | 2005-10-20 11:47:44 -0700 |
| commit | 5d54f3d8999eac1762fe0a8c7177d20f1f201fae (patch) | |
| tree | 65c7761c305dbd97609e64517f5781b433efa980 /usr/src/lib/libbc/libc/stdio/common/setbuffer.c | |
| parent | 1b42782e10f177b2bd092559506a96dbbefefa54 (diff) | |
| download | illumos-joyent-5d54f3d8999eac1762fe0a8c7177d20f1f201fae.tar.gz | |
6309237 gcc and libbc don't get along
Diffstat (limited to 'usr/src/lib/libbc/libc/stdio/common/setbuffer.c')
| -rw-r--r-- | usr/src/lib/libbc/libc/stdio/common/setbuffer.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/usr/src/lib/libbc/libc/stdio/common/setbuffer.c b/usr/src/lib/libbc/libc/stdio/common/setbuffer.c index 5b8ffb2aca..dd1afa49d9 100644 --- a/usr/src/lib/libbc/libc/stdio/common/setbuffer.c +++ b/usr/src/lib/libbc/libc/stdio/common/setbuffer.c @@ -34,23 +34,18 @@ * contributors. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* from UCB 4.2 83/02/27 */ +#pragma ident "%Z%%M% %I% %E% SMI" #include <stdio.h> +#include <malloc.h> +#include <unistd.h> -extern void free(); -extern int isatty(); extern unsigned char (*_smbuf)[_SBFSIZ]; -extern void _getsmbuf(); void -setbuffer(iop, buf, size) - register FILE *iop; - char *buf; - int size; +setbuffer(FILE *iop, char *buf, int size) { - register int fno = fileno(iop); /* file number */ + int fno = fileno(iop); /* file number */ if (iop->_base != NULL && iop->_flag&_IOMYBUF) free((char *)iop->_base); @@ -73,17 +68,17 @@ setbuffer(iop, buf, size) /* * set line buffering */ -setlinebuf(iop) - register FILE *iop; +int +setlinebuf(FILE *iop) { - register unsigned char *buf; - extern char *malloc(); + char *buf; fflush(iop); - setbuffer(iop, (unsigned char *)NULL, 0); - buf = (unsigned char *)malloc(128); + setbuffer(iop, NULL, 0); + buf = (char *)malloc(128); if (buf != NULL) { setbuffer(iop, buf, 128); iop->_flag |= _IOLBF|_IOMYBUF; } + return (0); } |
