Fix r_io_desc_new macro. It was breaking support for multiple files

This commit is contained in:
pancake 2013-11-19 03:02:26 +01:00
parent 3858f1b7dd
commit 58870cff95
2 changed files with 4 additions and 1 deletions

View File

@ -195,8 +195,12 @@ typedef struct r_io_cache_t {
desc->plugin = fplugin; \
desc->flags = fflags; \
if (ffd == -2) { \
int i; \
ut8 *p = (ut8 *)&(desc->fd); \
desc->fd = ((int) ((size_t) desc) & 0xffffff); \
desc->fd = p[0]; \
for (i=1; i<sizeof (desc->fd); i++) \
desc->fd ^= p[i]; \
} else \
if (ffd == -1) desc->fd = (int) (((size_t) desc) & 0xffffff); \
else desc->fd = ffd; \

View File

@ -92,7 +92,6 @@ static RIODesc *__open(struct r_io_t *io, const char *pathname, int rw, int mode
}
if (mal->buf != NULL) {
RETURN_IO_DESC_NEW(&r_io_plugin_malloc, mal->fd, pathname, rw, mode,mal);
//return r_io_desc_new (&r_io_plugin_malloc, mal->fd, pathname, rw, mode, mal);
}
eprintf ("Cannot allocate (%s) %d bytes\n", pathname+9,