diff options
author | Geoff Levand <geoff@infradead.org> | 2012-03-26 19:23:17 -0700 |
---|---|---|
committer | Geoff Levand <geoff@infradead.org> | 2012-03-26 19:23:17 -0700 |
commit | 09cc1ef3d7e2c1dab6648aceb24dd33e7897f998 (patch) | |
tree | c270bc7b9f5bf0962f87a1681ef8924f10a0e751 /ui/twin/main-ps3.c | |
parent | dbb6ce1119c8fc1f30bb18062b5ab3d6260bb0b1 (diff) | |
download | petitboot-09cc1ef3d7e2c1dab6648aceb24dd33e7897f998.zip petitboot-09cc1ef3d7e2c1dab6648aceb24dd33e7897f998.tar.gz |
Log to stderr, allow --log=-
Signed-off-by: Geoff Levand <geoff@infradead.org>
Diffstat (limited to 'ui/twin/main-ps3.c')
-rw-r--r-- | ui/twin/main-ps3.c | 11 |
1 files changed, 7 insertions, 4 deletions
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); |