On Wed, 13.02.13 11:37, William Giokas ([email protected]) wrote:

> os-release is required for systemd now, so use that file and stop
> printing 'Unknown' on the bootchart.

Actually, this code should probably use load_env_file() instead anyway...

> ---
>  src/bootchart/svg.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c
> index d7c4168..ec81da9 100644
> --- a/src/bootchart/svg.c
> +++ b/src/bootchart/svg.c
> @@ -195,11 +195,15 @@ static void svg_title(void)
>                  fclose(f);
>          }
>  
> -        /* Build - 1st line from /etc/system-release */
> -        f = fopen("/etc/system-release", "r");
> +        /* Build - NAME line from /etc/os-release */
> +        f = fopen("/etc/os-release", "r");
>          if (f) {
> -                if (fgets(buf, 255, f))
> -                        strncpy(build, buf, 255);
> +                while (fgets(buf, 255, f)) {
> +                        if (strstr(buf, "NAME=")) {
> +                                strncpy(build, &buf[5], 255);
> +                                break;
> +                        }
> +                }
>                  fclose(f);
>          }
>  


Lennart

-- 
Lennart Poettering - Red Hat, Inc.
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to