Fix resize command and more make race conditions
This commit is contained in:
parent
09642b4eec
commit
10b4b5546c
|
@ -4,7 +4,8 @@ CFLAGS+=-DCORELIB -Iarch/include -Iarch -I../../shlr
|
|||
|
||||
include ../config.mk
|
||||
|
||||
foo: pre ${LIBSO} ${LIBAR} plugins
|
||||
foo:
|
||||
@for a in pre ${LIBSO} ${LIBAR} plugins ; do ${MAKE} $$a ; done
|
||||
|
||||
include ${STATIC_ASM_PLUGINS}
|
||||
STATIC_OBJS=$(subst ..,p/..,$(subst asm_,p/asm_,$(STATIC_OBJ)))
|
||||
|
|
|
@ -6,7 +6,8 @@ include ../config.mk
|
|||
|
||||
CFLAGS+=-DCORELIB
|
||||
|
||||
foo: ${LIBSO} ${LIBAR} plugins
|
||||
foo:
|
||||
for a in ${LIBSO} ${LIBAR} plugins ; do ${MAKE} $$a ; done
|
||||
|
||||
include ${STATIC_CMD_PLUGINS}
|
||||
STATIC_OBJS=$(subst ..,p/..,$(subst cmd_,p/cmd_,$(STATIC_OBJ)))
|
||||
|
|
|
@ -282,7 +282,7 @@ static int cmd_resize(void *data, const char *input) {
|
|||
" r+num insert num bytes, move following data up\n");
|
||||
return R_TRUE;
|
||||
default:
|
||||
newsize = r_num_math (core->num, input+1);
|
||||
newsize = r_num_math (core->num, input);
|
||||
}
|
||||
|
||||
grow = (newsize > oldsize);
|
||||
|
|
|
@ -126,8 +126,11 @@ static int cmd_write(void *data, const char *input) {
|
|||
case ' ':
|
||||
/* write string */
|
||||
len = r_str_escape (str);
|
||||
r_core_write_at (core, core->offset, str, len);
|
||||
#if 0
|
||||
r_io_set_fd (core->io, core->file->fd);
|
||||
r_io_write_at (core->io, core->offset, (const ut8*)str, len);
|
||||
#endif
|
||||
WSEEK (core, len);
|
||||
r_core_block_read (core, 0);
|
||||
break;
|
||||
|
|
|
@ -138,6 +138,7 @@ R_API int r_core_write_at(RCore *core, ut64 addr, const ut8 *buf, int size) {
|
|||
if (addr >= core->offset && addr <= core->offset+core->blocksize)
|
||||
r_core_block_read (core, 0);
|
||||
}
|
||||
core->file->size = r_io_size (core->io);
|
||||
return (ret==-1)? R_FALSE: R_TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,8 @@ CFLAGS+=-DCORELIB
|
|||
|
||||
include ../config.mk
|
||||
|
||||
foo: pre libr_crypto.${EXT_SO} libr_crypto.${EXT_AR} plugins
|
||||
foo:
|
||||
for a in pre libr_crypto.${EXT_SO} libr_crypto.${EXT_AR} plugins ; do ${MAKE} $$a ; done
|
||||
|
||||
include ${STATIC_CRYPTO_PLUGINS}
|
||||
STATIC_OBJS=$(subst ..,p/..,$(subst crypto_,p/crypto_,$(STATIC_OBJ)))
|
||||
|
|
|
@ -10,8 +10,8 @@ OBJ+=emit_arm.o
|
|||
OBJ+=emit_x64.o
|
||||
OBJ+=emit_trace.o
|
||||
|
||||
foo: ${LIBSO} ${LIBAR}
|
||||
${MAKE} all
|
||||
foo:
|
||||
for a in ${LIBSO} ${LIBAR} all ; do ${MAKE} $$a ; done
|
||||
|
||||
P=p/
|
||||
include ${STATIC_EGG_PLUGINS}
|
||||
|
|
|
@ -8,7 +8,8 @@ LDFLAGS+=p/grub/libgrubfs.a
|
|||
include ../config.mk
|
||||
|
||||
EXTRA_TARGETS=plugins
|
||||
foo: pre plugins ${LIBSO} ${LIBAR}
|
||||
foo:
|
||||
for a in pre plugins ${LIBSO} ${LIBAR} ; do ${MAKE} $$a ; done
|
||||
|
||||
include ${STATIC_FS_PLUGINS}
|
||||
STATIC_OBJS=$(subst ..,p/..,$(subst fs_,p/fs_,$(STATIC_OBJ)))
|
||||
|
|
|
@ -144,12 +144,11 @@ R_API int r_io_set_fd(RIO *io, RIODesc *fd) {
|
|||
R_API int r_io_set_fdn(RIO *io, int fd) {
|
||||
if (fd != -1 && io->fd != NULL && fd != io->fd->fd) {
|
||||
RIODesc *desc = r_io_desc_get (io, fd);
|
||||
if (desc) {
|
||||
if (!desc) return R_FALSE;
|
||||
io->fd = desc;
|
||||
io->plugin = desc->plugin;
|
||||
return R_TRUE;
|
||||
}
|
||||
}
|
||||
return R_FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue