aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-03-13 10:44:15 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-03-13 10:49:04 +0100
commit6424e8df84935fe10ef2be9c689760ebbb229d16 (patch)
treed6dccb94b46738a289c5138bd16dada94c10f5ce
parent13eece07b52361b2a3273ef4243c5d4e3ce7881e (diff)
test/test_dbus.c: make --log and --log-bin args optionalHEADmaster
It is very useful to run this tool as just: ./test/test_dbus And run zbarimg on a separate window, as this allows to quickly check if ZBar dbus code is working fine. Let's keep accepting such behaviour by making the two log arguments optional. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--test/test_dbus.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/test_dbus.c b/test/test_dbus.c
index 4669c9c..2d2be6a 100644
--- a/test/test_dbus.c
+++ b/test/test_dbus.c
@@ -96,10 +96,11 @@ int main(int argc, char *argv[])
return -1;
}
- if (log == NULL || bin_log == NULL) {
- fprintf(stderr, "Log files not specified\n");
- return -1;
- }
+ if (!log)
+ log = fdopen(dup(fileno(stderr)), "w+");
+
+ if (!bin_log)
+ bin_log = fdopen(dup(fileno(stderr)), "w+");
// initialise the error value
dbus_error_init(&err);

Privacy Policy