sysinfo: Fix showing debian version on ubuntu

This commit is contained in:
TingPing 2013-10-20 21:15:12 -04:00
parent 712cfc3135
commit 62735c54fb
1 changed files with 6 additions and 6 deletions

View File

@ -399,12 +399,6 @@ int xs_parse_distro(char *name)
fgets(buffer, bsize, fp); fgets(buffer, bsize, fp);
else if((fp = fopen("/etc/mandrake-release", "r")) != NULL) else if((fp = fopen("/etc/mandrake-release", "r")) != NULL)
fgets(buffer, bsize, fp); fgets(buffer, bsize, fp);
else if((fp = fopen("/etc/debian_version", "r")) != NULL)
{
char release[bsize];
fgets(release, bsize, fp);
snprintf(buffer, bsize, "Debian %s", release);
}
else if((fp = fopen("/etc/SuSE-release", "r")) != NULL) else if((fp = fopen("/etc/SuSE-release", "r")) != NULL)
fgets(buffer, bsize, fp); fgets(buffer, bsize, fp);
else if((fp = fopen("/etc/turbolinux-release", "r")) != NULL) else if((fp = fopen("/etc/turbolinux-release", "r")) != NULL)
@ -425,6 +419,12 @@ int xs_parse_distro(char *name)
} }
snprintf(buffer, bsize, "%s \"%s\" %s", id, codename, release); snprintf(buffer, bsize, "%s \"%s\" %s", id, codename, release);
} }
else if((fp = fopen("/etc/debian_version", "r")) != NULL)
{
char release[bsize];
fgets(release, bsize, fp);
snprintf(buffer, bsize, "Debian %s", release);
}
else else
snprintf(buffer, bsize, "Unknown Distro"); snprintf(buffer, bsize, "Unknown Distro");
if(fp != NULL) fclose(fp); if(fp != NULL) fclose(fp);