aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2018-10-11 18:21:42 +0200
committerToni Uhlig <matzeton@googlemail.com>2018-10-11 18:21:42 +0200
commita182509960b87569402df5fec10700b163787d5c (patch)
treeba5798cdfa22b9d6c601b03d4c424f941d2de749
parent7076ba694204c48d4b8037f8ba2822abd23454ea (diff)
luks_test.sh: redirect stderr to log file
main.c: removed obsolete waitpid and WIFEXITED check Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rwxr-xr-xluks_test.sh6
-rw-r--r--src/main.c7
2 files changed, 5 insertions, 8 deletions
diff --git a/luks_test.sh b/luks_test.sh
index 971ab3b..98be5ea 100755
--- a/luks_test.sh
+++ b/luks_test.sh
@@ -26,10 +26,10 @@ if [ ! -w ${FILE} ] || [ `file ${FILE} | grep -qoE 'LUKS encrypted file' && echo
fi
if [ "x${DEBUG}" != "x" ]; then
- sudo valgrind --log-file=valgrind.log src/naskpass -f ./${NAME}.fifo -c "/sbin/cryptsetup open ${FILE} ${NAME}" || true
- sudo valgrind --tool=helgrind --log-file=helgrind.log src/naskpass -f ./${NAME}.fifo -c "/sbin/cryptsetup open ${FILE} ${NAME}" || true
+ sudo valgrind --log-file=valgrind.log src/naskpass -f ./${NAME}.fifo -c "/sbin/cryptsetup open ${FILE} ${NAME}" 2>./${NAME}_err.log || true
+ sudo valgrind --tool=helgrind --log-file=helgrind.log src/naskpass -f ./${NAME}.fifo -c "/sbin/cryptsetup open ${FILE} ${NAME}" 2>./${NAME}_err_hell.log || true
else
- sudo src/naskpass -f ./${NAME}.fifo -c "/sbin/cryptsetup open ${FILE} ${NAME}"
+ sudo src/naskpass -f ./${NAME}.fifo -c "/sbin/cryptsetup open ${FILE} ${NAME}" 2>./${NAME}_err.log
fi
set +e
diff --git a/src/main.c b/src/main.c
index a6a3311..1715dbb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -128,7 +128,9 @@ main(int argc, char **argv)
/* child */
logs("%s\n", "child");
if (ffd >= 0) close(ffd);
+#ifndef DEBUG
fclose(stderr);
+#endif
/* Slave process: TUI */
if (ui_ipc_init(0) == 0) {
do_ui();
@@ -170,11 +172,6 @@ main(int argc, char **argv)
//ui_ipc_sempost(SEM_IN);
}
usleep(100000);
- waitpid(child, &c_status, WNOHANG);
- if ( WIFEXITED(c_status) != 0 ) {
- logs("%s\n", "child exited");
- ui_ipc_semtrywait(SEM_UI);
- }
}
logs("%s\n", "waiting for child");
wait(&c_status);