Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2b8eb6d
)
lib: Fixed uncompiled bugs in the funopen path.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 2 Mar 2014 09:25:47 +0000
(10:25 +0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 2 Mar 2014 09:25:47 +0000
(10:25 +0100)
lib/utils.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/utils.c
b/lib/utils.c
index
ed22b42
..
e2c85a9
100644
(file)
--- a/
lib/utils.c
+++ b/
lib/utils.c
@@
-518,6
+518,8
@@
static int wrapclose(void *pdata)
if(nf->close != NULL)
ret = nf->close(nf->pdata);
if(nf->close != NULL)
ret = nf->close(nf->pdata);
+ else
+ ret = 0;
free(nf);
return(ret);
}
free(nf);
return(ret);
}
@@
-581,6
+583,8
@@
static int wrapclose(void *pdata)
if(nf->close != NULL)
ret = nf->close(nf->pdata);
if(nf->close != NULL)
ret = nf->close(nf->pdata);
+ else
+ ret = 0;
free(nf);
return(ret);
}
free(nf);
return(ret);
}
@@
-594,7
+598,8
@@
FILE *funstdio(void *pdata,
struct stdif *nf;
omalloc(nf);
struct stdif *nf;
omalloc(nf);
- return(funopen(pdata, read?wrapread:NULL, write:wrapwrite:NULL, seek:wrapseek:NULL, wrapclose));
+ *nf = (struct stdif){.read = read, .write = write, .seek = seek, .close = close, .pdata = pdata};
+ return(funopen(nf, read?wrapread:NULL, write?wrapwrite:NULL, seek?wrapseek:NULL, wrapclose));
}
#else
#error "No stdio implementation for this system"
}
#else
#error "No stdio implementation for this system"