From cdbb3008ccfd21003df635c3d522051c02f19e15 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 24 May 2012 15:38:46 +0100 Subject: inspection: Use parse_release_file to parse ttylinux release file. parse_release_file should be used to set fs->product_name, instead of calling guestfs___first_line_of_file directory, although currently the two are equivalent. This is code motion and fixes commit b648b1813fc8e55db790435b5414d9be3ec765d2. (cherry picked from commit cffb7fefc88a317f957785f6448fb24183c8c629) --- src/inspect_fs_unix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/inspect_fs_unix.c b/src/inspect_fs_unix.c index 5695adc1..2caf4002 100644 --- a/src/inspect_fs_unix.c +++ b/src/inspect_fs_unix.c @@ -450,8 +450,7 @@ guestfs___check_linux_root (guestfs_h *g, struct inspect_fs *fs) else if (guestfs_exists (g, "/etc/ttylinux-target") > 0) { fs->distro = OS_DISTRO_TTYLINUX; - fs->product_name = guestfs___first_line_of_file (g, "/etc/ttylinux-target"); - if (fs->product_name == NULL) + if (parse_release_file (g, fs, "/etc/ttylinux-target") == -1) return -1; if (guestfs___parse_major_minor (g, fs) == -1) -- cgit