mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
tests: be a bit more strict cleaning up fifos
When we re-factored we dropped the unlink() step which turns out to be
required for rmdir to do its thing. If we had been checking the return
value we would have noticed so lets do that with this fix.
Fixes: 68406d1085
(tests/unit: cleanups for test-io-channel-command)
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230228190653.1602033-4-alex.bennee@linaro.org>
This commit is contained in:
@ -42,6 +42,7 @@ static void test_io_channel_command_fifo(bool async)
|
||||
g_auto(GStrv) dstargv = g_strsplit(dstargs, " ", -1);
|
||||
QIOChannel *src, *dst;
|
||||
QIOChannelTest *test;
|
||||
int err;
|
||||
|
||||
if (mkfifo(fifo, 0600)) {
|
||||
g_error("mkfifo: %s", strerror(errno));
|
||||
@ -61,7 +62,10 @@ static void test_io_channel_command_fifo(bool async)
|
||||
object_unref(OBJECT(src));
|
||||
object_unref(OBJECT(dst));
|
||||
|
||||
g_rmdir(tmpdir);
|
||||
err = g_unlink(fifo);
|
||||
g_assert(err == 0);
|
||||
err = g_rmdir(tmpdir);
|
||||
g_assert(err == 0);
|
||||
}
|
||||
|
||||
static void test_io_channel_command_fifo_async(void)
|
||||
|
Reference in New Issue
Block a user