diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2017-02-14 19:49:46 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2017-02-20 16:48:23 +0000 |
commit | 898ae926dfa0346ad49ed652bd3004705dfc069d (patch) | |
tree | 60f6a8946ac45c264ddfdca741145cac4f73ac7e /test/loopback.c | |
parent | eef176eb72c17773610ef2780133ad2a65fd26c2 (diff) | |
download | dbus-898ae926dfa0346ad49ed652bd3004705dfc069d.tar.gz |
tests: Wrap file-deletion functions to handle EINTR
The GLib functions we're using don't, and it seems to be possible to be
interrupted during cleanup for our tests.
Windows apparently has and uses ENOENT for _unlink(), so just do the
same on Windows there; but EINTR is very much a POSIX thing, so ignore
that on Windows.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825
Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: add Windows fixes from a later commit, also reviewed by Philip]
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'test/loopback.c')
-rw-r--r-- | test/loopback.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/loopback.c b/test/loopback.c index bf0542aa..5232a09a 100644 --- a/test/loopback.c +++ b/test/loopback.c @@ -332,10 +332,10 @@ teardown_runtime (Fixture *f, /* the socket may exist */ path = g_strdup_printf ("%s/bus", f->tmp_runtime_dir); - g_assert (g_remove (path) == 0 || errno == ENOENT); + test_remove_if_exists (path); g_free (path); /* there shouldn't be anything else in there */ - g_assert_cmpint (g_rmdir (f->tmp_runtime_dir), ==, 0); + test_rmdir_must_exist (f->tmp_runtime_dir); /* we're relying on being single-threaded for this to be safe */ if (f->saved_runtime_dir != NULL) |