summaryrefslogtreecommitdiffstats
path: root/ui/twin
diff options
context:
space:
mode:
Diffstat (limited to 'ui/twin')
-rw-r--r--ui/twin/main-generic.c11
-rw-r--r--ui/twin/main-ps3.c11
2 files changed, 14 insertions, 8 deletions
diff --git a/ui/twin/main-generic.c b/ui/twin/main-generic.c
index ce6a573..7cf510a 100644
--- a/ui/twin/main-generic.c
+++ b/ui/twin/main-generic.c
@@ -285,7 +285,6 @@ int main(int argc, char *argv[])
static struct pbt_opts opts;
int result;
int ui_result;
- FILE *log;
struct pbt_client *client;
result = pbt_opts_parse(&opts, argc, argv);
@@ -305,9 +304,13 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS;
}
- log = fopen(opts.log_file, "a");
- assert(log);
- pb_log_set_stream(log);
+ if (strcmp(opts.log_file, "-")) {
+ FILE *log = fopen(opts.log_file, "a");
+
+ assert(log);
+ pb_log_set_stream(log);
+ } else
+ pb_log_set_stream(stderr);
#if defined(DEBUG)
pb_log_always_flush(1);
diff --git a/ui/twin/main-ps3.c b/ui/twin/main-ps3.c
index 66ba561..138cd28 100644
--- a/ui/twin/main-ps3.c
+++ b/ui/twin/main-ps3.c
@@ -372,7 +372,6 @@ int main(int argc, char *argv[])
int result;
int ui_result = -1;
unsigned int mode;
- FILE *log;
result = pbt_opts_parse(&opts, argc, argv);
@@ -391,9 +390,13 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS;
}
- log = fopen(opts.log_file, "a");
- assert(log);
- pb_log_set_stream(log);
+ if (strcmp(opts.log_file, "-")) {
+ FILE *log = fopen(opts.log_file, "a");
+
+ assert(log);
+ pb_log_set_stream(log);
+ } else
+ pb_log_set_stream(stderr);
#if defined(DEBUG)
pb_log_always_flush(1);
OpenPOWER on IntegriCloud