* [PATCH] unit/test-dbus: pick up dbus-daemon from $PATH
@ 2020-12-27 12:16 Florian Klink
2020-12-30 18:02 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Florian Klink @ 2020-12-27 12:16 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 2291 bytes --]
This allows running the unit tests in environments where `dbus-daemon`
isn't in /usr/bin, but in $PATH.
Signed-off-by: Florian Klink <flokli@flokli.de>
---
unit/test-dbus-message-fds.c | 4 ++--
unit/test-dbus-properties.c | 4 ++--
unit/test-dbus.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/unit/test-dbus-message-fds.c b/unit/test-dbus-message-fds.c
index 6f68bae..4b5662e 100644
--- a/unit/test-dbus-message-fds.c
+++ b/unit/test-dbus-message-fds.c
@@ -51,7 +51,7 @@ static bool start_dbus_daemon(void)
char *prg_envp[1];
pid_t pid;
- prg_argv[0] = "/usr/bin/dbus-daemon";
+ prg_argv[0] = "dbus-daemon";
prg_argv[1] = "--nopidfile";
prg_argv[2] = "--nofork";
prg_argv[3] = "--config-file=" UNITDIR "dbus.conf";
@@ -68,7 +68,7 @@ static bool start_dbus_daemon(void)
}
if (pid == 0) {
- execve(prg_argv[0], prg_argv, prg_envp);
+ execvpe(prg_argv[0], prg_argv, prg_envp);
exit(EXIT_SUCCESS);
}
diff --git a/unit/test-dbus-properties.c b/unit/test-dbus-properties.c
index b435062..049f0f4 100644
--- a/unit/test-dbus-properties.c
+++ b/unit/test-dbus-properties.c
@@ -49,7 +49,7 @@ static bool start_dbus_daemon(void)
char *prg_envp[1];
pid_t pid;
- prg_argv[0] = "/usr/bin/dbus-daemon";
+ prg_argv[0] = "dbus-daemon";
prg_argv[1] = "--nopidfile";
prg_argv[2] = "--nofork";
prg_argv[3] = "--config-file=" UNITDIR "dbus.conf";
@@ -66,7 +66,7 @@ static bool start_dbus_daemon(void)
}
if (pid == 0) {
- execve(prg_argv[0], prg_argv, prg_envp);
+ execvpe(prg_argv[0], prg_argv, prg_envp);
exit(EXIT_SUCCESS);
}
diff --git a/unit/test-dbus.c b/unit/test-dbus.c
index 67f0a7b..582847e 100644
--- a/unit/test-dbus.c
+++ b/unit/test-dbus.c
@@ -45,7 +45,7 @@ static void start_dbus_daemon(void)
char *prg_envp[1];
pid_t pid;
- prg_argv[0] = "/usr/bin/dbus-daemon";
+ prg_argv[0] = "dbus-daemon";
prg_argv[1] = "--nopidfile";
prg_argv[2] = "--nofork";
prg_argv[3] = "--config-file=" UNITDIR "dbus.conf";
@@ -62,7 +62,7 @@ static void start_dbus_daemon(void)
}
if (pid == 0) {
- execve(prg_argv[0], prg_argv, prg_envp);
+ execvpe(prg_argv[0], prg_argv, prg_envp);
exit(EXIT_SUCCESS);
}
--
2.29.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] unit/test-dbus: pick up dbus-daemon from $PATH
2020-12-27 12:16 [PATCH] unit/test-dbus: pick up dbus-daemon from $PATH Florian Klink
@ 2020-12-30 18:02 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2020-12-30 18:02 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 507 bytes --]
Hi Florian,
On 12/27/20 6:16 AM, Florian Klink wrote:
> This allows running the unit tests in environments where `dbus-daemon`
> isn't in /usr/bin, but in $PATH.
>
> Signed-off-by: Florian Klink <flokli@flokli.de>
We don't use SoB tags, so I took this out...
> ---
> unit/test-dbus-message-fds.c | 4 ++--
> unit/test-dbus-properties.c | 4 ++--
> unit/test-dbus.c | 4 ++--
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
Applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-30 18:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-27 12:16 [PATCH] unit/test-dbus: pick up dbus-daemon from $PATH Florian Klink
2020-12-30 18:02 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.