1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

exec_on_master_terminal(): reduce code redundancy a bit and use

fmem_alloc() instead of mem_alloc().
This commit is contained in:
Laurent MONIN 2006-01-07 01:52:35 +01:00 committed by Laurent MONIN
parent b09d2c7a3f
commit df138c775a

View File

@ -214,7 +214,7 @@ exec_on_master_terminal(struct terminal *term,
} }
param_size = plen + dlen + 2 /* 2 null char */ + 1 /* fg */; param_size = plen + dlen + 2 /* 2 null char */ + 1 /* fg */;
param = mem_alloc(param_size); param = fmem_alloc(param_size);
if (!param) return; if (!param) return;
param[0] = fg; param[0] = fg;
@ -225,13 +225,12 @@ exec_on_master_terminal(struct terminal *term,
blockh = start_thread((void (*)(void *, int)) exec_thread, blockh = start_thread((void (*)(void *, int)) exec_thread,
param, param_size); param, param_size);
fmem_free(param);
if (blockh == -1) { if (blockh == -1) {
if (fg == 1) unblock_itrm(term->fdin); if (fg == 1) unblock_itrm(term->fdin);
mem_free(param);
return; return;
} }
mem_free(param);
if (fg == 1) { if (fg == 1) {
term->blocked = blockh; term->blocked = blockh;
set_handlers(blockh, set_handlers(blockh,