compositor: Print error opening log file
authorAntonio Caggiano <antonio.caggiano@collabora.com>
Thu, 28 May 2020 14:28:08 +0000 (16:28 +0200)
committerSimon Ser <contact@emersion.fr>
Mon, 1 Jun 2020 18:03:33 +0000 (18:03 +0000)
When failing to open the log file nothing is reported to the user,
therefore we print a message on stderr when that happens.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Suggested-by: Pekka Paalanen <pekka.paalanen@collabora.com>
compositor/main.c

index c1a7270172d06bf1d08875be764b7cb5598da422..af31c94e6ea68b0a8be21aff2af22e4690436852 100644 (file)
@@ -180,6 +180,8 @@ weston_log_file_open(const char *filename)
                weston_logfile = fopen(filename, "a");
                if (weston_logfile)
                        os_fd_set_cloexec(fileno(weston_logfile));
+               else
+                       fprintf(stderr, "Failed to open %s: %s\n", filename, strerror(errno));
        }
 
        if (weston_logfile == NULL)