summaryrefslogtreecommitdiffstats
path: root/lib/libI77/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libI77/open.c')
-rw-r--r--lib/libI77/open.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libI77/open.c b/lib/libI77/open.c
index 75386b9..beb525e 100644
--- a/lib/libI77/open.c
+++ b/lib/libI77/open.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
#ifndef NON_UNIX_STDIO
#include "sys/types.h"
#include "sys/stat.h"
@@ -28,9 +29,9 @@ char *f__w_mode[4] = {"wb", "w", "r+b", "r+"};
#endif
#ifdef KR_headers
-f__isdev(s) char *s;
+int f__isdev(s) char *s;
#else
-f__isdev(char *s)
+int f__isdev(char *s)
#endif
{
#ifdef NON_UNIX_STDIO
@@ -164,7 +165,7 @@ integer f_open(olist *a)
case 'R':
replace:
#ifdef NON_UNIX_STDIO
- if (tf = fopen(buf,f__w_mode[0]))
+ if ( (tf = fopen(buf,f__w_mode[0])) )
fclose(tf);
#else
(void) close(creat(buf, 0666));
@@ -187,9 +188,9 @@ integer f_open(olist *a)
else {
if(!(b->ufd = fopen(buf, f__r_mode[ufmt]))) {
#ifdef NON_UNIX_STDIO
- if (b->ufd = fopen(buf, f__w_mode[ufmt|2]))
+ if ( (b->ufd = fopen(buf, f__w_mode[ufmt|2])) )
b->uwrt = 2;
- else if (b->ufd = fopen(buf, f__w_mode[ufmt]))
+ else if ( (b->ufd = fopen(buf, f__w_mode[ufmt])) )
b->uwrt = 1;
else
#else
@@ -219,9 +220,9 @@ integer f_open(olist *a)
return(0);
}
#ifdef KR_headers
-fk_open(seq,fmt,n) ftnint n;
+int fk_open(seq,fmt,n) ftnint n;
#else
-fk_open(int seq, int fmt, ftnint n)
+int fk_open(int seq, int fmt, ftnint n)
#endif
{ char nbuf[10];
olist a;
OpenPOWER on IntegriCloud