From d68c8177e7893e2a2f37cd8ecd17b0ff6f2acd57 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 23 May 2013 21:14:50 +0200 Subject: system: Prevent z_SUITE from changing the timestamp on core files --- erts/test/z_SUITE.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'erts') diff --git a/erts/test/z_SUITE.erl b/erts/test/z_SUITE.erl index 78968ed405..9abc73c081 100644 --- a/erts/test/z_SUITE.erl +++ b/erts/test/z_SUITE.erl @@ -190,8 +190,13 @@ file_inspect(#core_search_conf{file = File}, Core) -> probably_a_core end. -mk_readable(F) -> - catch file:write_file_info(F, #file_info{mode = 8#00444}). +mk_readable(F) -> + try + {ok, Old} = file:read_file_info(F), + file:write_file_info(F, Old#file_info{mode = 8#00444}) + catch + _:_ -> io:format("Failed to \"chmod\" core file ~p\n", [F]) + end. ignore_core(C) -> filelib:is_regular(filename:join([filename:dirname(C), -- cgit v1.2.3 From 1570d589c1ea8323baaa5b81b472a2a587c012e8 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 30 May 2013 19:28:38 +0200 Subject: kernel: Fix bug in file:pwrite for large data sets Bug introduced in a73414d2e8ad03538 and never released. --- erts/emulator/drivers/common/efile_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts') diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c index 6cc1295973..595b0488a8 100644 --- a/erts/emulator/drivers/common/efile_drv.c +++ b/erts/emulator/drivers/common/efile_drv.c @@ -1679,10 +1679,10 @@ static void invoke_pwritev(void *data) { d->again = 0; } } else - ASSERT(written == FILE_SEGMENT_WRITE); + ASSERT(written >= FILE_SEGMENT_WRITE); MUTEX_LOCK(d->c.writev.q_mtx); - driver_deq(d->c.pwritev.port, size); + driver_deq(d->c.pwritev.port, written); MUTEX_UNLOCK(d->c.writev.q_mtx); done: EF_FREE(iov); /* Free our copy of the vector, nothing to restore */ -- cgit v1.2.3