From: Chris Wilson Date: Sun, 25 Aug 2013 14:17:39 +0000 (+0100) Subject: overlay: Detach from terminal X-Git-Tag: intel-gpu-tools-1.4~98 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=39f9812315546b8b5044d8372c7e9c3055151882;p=platform%2Fupstream%2Fintel-gpu-tools.git overlay: Detach from terminal Signed-off-by: Chris Wilson --- diff --git a/overlay/overlay.c b/overlay/overlay.c index a1d21df..67c4a86 100644 --- a/overlay/overlay.c +++ b/overlay/overlay.c @@ -734,12 +734,13 @@ int main(int argc, char **argv) struct overlay_context ctx; struct config config; int index, sample_period; + int daemonize = 1; int i; config_init(&config); opterr = 0; - while ((i = getopt_long(argc, argv, "c:", long_options, &index)) != -1) { + while ((i = getopt_long(argc, argv, "c:f", long_options, &index)) != -1) { switch (i) { case 'c': config_parse_string(&config, optarg); @@ -750,6 +751,9 @@ int main(int argc, char **argv) case 'P': config_set_value(&config, "window", "position", optarg); break; + case 'f': + daemonize = 0; + break; } } @@ -770,6 +774,9 @@ int main(int argc, char **argv) if (ctx.surface == NULL) return ENOMEM; + if (daemonize && daemon(0, 0)) + return EINVAL; + signal(SIGUSR1, signal_snapshot); debugfs_init();