summaryrefslogtreecommitdiff
path: root/test/test-utils-glib.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2017-02-14 15:10:20 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2017-02-21 13:24:02 +0000
commit3d5bc65333f3ab6437ddeeed1f4e30856aa32e6b (patch)
tree087ba1b47675258283cdc8af4aa9e92384076829 /test/test-utils-glib.c
parentff03660715bee6b97fa6bed179f23316cf28723f (diff)
downloaddbus-3d5bc65333f3ab6437ddeeed1f4e30856aa32e6b.tar.gz
sd-activation test: Exercise transient services
To do this, we have to use the <standard_session_servicedirs/>. A previous commit ensured that those don't provide any service files we don't expect. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'test/test-utils-glib.c')
-rw-r--r--test/test-utils-glib.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/test-utils-glib.c b/test/test-utils-glib.c
index e60a40d3..e13d20d3 100644
--- a/test/test-utils-glib.c
+++ b/test/test-utils-glib.c
@@ -570,3 +570,25 @@ test_rmdir_if_exists (const gchar *path)
g_strerror (saved_errno));
}
}
+
+/*
+ * Create directory @path, with a retry loop if the system call is
+ * interrupted by an async signal.
+ */
+void
+test_mkdir (const gchar *path,
+ gint mode)
+{
+ while (g_mkdir (path, mode) != 0)
+ {
+ int saved_errno = errno;
+
+#ifdef G_OS_UNIX
+ if (saved_errno == EINTR)
+ continue;
+#endif
+
+ g_error ("Unable to create directory \"%s\": %s", path,
+ g_strerror (saved_errno));
+ }
+}