summaryrefslogtreecommitdiff
path: root/usr/src/lib/libbc/libc/stdio/common/setbuffer.c
diff options
context:
space:
mode:
authormuffin <none@none>2005-10-20 11:47:44 -0700
committermuffin <none@none>2005-10-20 11:47:44 -0700
commit5d54f3d8999eac1762fe0a8c7177d20f1f201fae (patch)
tree65c7761c305dbd97609e64517f5781b433efa980 /usr/src/lib/libbc/libc/stdio/common/setbuffer.c
parent1b42782e10f177b2bd092559506a96dbbefefa54 (diff)
downloadillumos-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.c27
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);
}