|
From: <bc...@us...> - 2007-09-10 16:20:05
|
Revision: 485
http://omc.svn.sourceforge.net/omc/?rev=485&view=rev
Author: bcwise
Date: 2007-09-10 09:20:08 -0700 (Mon, 10 Sep 2007)
Log Message:
-----------
REMOVED commented out code. This code was commented out for debugging,
but was not uncommented.
CHANGED some of the references to structure elements, because the
elements changed.
Modified Paths:
--------------
base/branches/1.0/src/providers/operating-system/linux_os.cpp
Modified: base/branches/1.0/src/providers/operating-system/linux_os.cpp
===================================================================
--- base/branches/1.0/src/providers/operating-system/linux_os.cpp 2007-09-05 14:27:05 UTC (rev 484)
+++ base/branches/1.0/src/providers/operating-system/linux_os.cpp 2007-09-10 16:20:08 UTC (rev 485)
@@ -126,7 +126,6 @@
* Function: read_distro_info
*
*/
-#if 0
void
read_distro_info()
{
@@ -141,7 +140,7 @@
output = "";
String cmd = "/bin/rpm -q ";
- cmd += install_rpm_data[i].file.c_str();
+ cmd += install_rpm_data[i].file;
try
{
@@ -166,7 +165,7 @@
// and desc for all distros
for(i = 0; i < INSTALL_FILE_DATA_SIZE; i++)
{
- ifstream ifstr(install_file_data[i].file.c_str(), std::ios::in);
+ ifstream ifstr(install_file_data[i].file, std::ios::in);
if (!ifstr)
{
continue;
@@ -220,7 +219,6 @@
g_bDistroInfoRead = true;
}
-#endif
@@ -228,7 +226,6 @@
* Function: get_distro_name
*
*/
-#if 0
String
get_distro_name()
{
@@ -236,14 +233,12 @@
read_distro_info();
return g_cim_os_distro_name;
} // get_distro_element_name()
-#endif
/*---------------------------------------------------------------------------
* Function: get_distro_element_name
*
*/
-#if 0
String
get_distro_element_name()
{
@@ -251,14 +246,12 @@
read_distro_info();
return g_cim_os_distro_element_name;
} // get_distro_element_name()
-#endif
/*---------------------------------------------------------------------------
* Function: get_distro_desc
*
*/
-#if 0
String
get_distro_desc()
{
@@ -266,7 +259,6 @@
read_distro_info();
return g_cim_os_distro_desc;
} // get_distro_desc()
-#endif
/*---------------------------------------------------------------------------
@@ -464,12 +456,8 @@
String
LinuxOperatingSystem::getDescription()
{
-#if 0
//return "A class derived from OperatingSystem to represents the running Linux OS.";
return get_distro_desc();
-#else
- return String("");
-#endif
} // LinuxOperatingSystem::getDescription()
@@ -481,11 +469,7 @@
String
LinuxOperatingSystem::getElementName()
{
-#if 0
return get_distro_element_name();
-#else
- return String();
-#endif
} // LinuxOperatingSystem::getElementName()
@@ -497,11 +481,7 @@
String
LinuxOperatingSystem::getDistroName()
{
-#if 0
return get_distro_name();
-#else
- return String();
-#endif
} // LinuxOperatingSystem::getDistroName()
@@ -566,7 +546,6 @@
CIMDateTime
LinuxOperatingSystem::getInstallDate()
{
-#if 0
int i;
/*
@@ -574,9 +553,9 @@
*/
for(i = 0;i < (int) (sizeof(install_rpm_data) / sizeof(distro_file_t)); i++) {
//if(strstr(CIM_OS_DISTRO, install_rpm_data[i].distro.c_str()) != NULL) {
- if (get_distro_name().indexOf(install_rpm_data[i].distro.c_str()) != String::npos) {
+ if (get_distro_name().indexOf(install_rpm_data[i].distro) != String::npos) {
String cmd = "/bin/rpm -q --queryformat %{INSTALLTIME} ";
- cmd += install_rpm_data[i].file.c_str();
+ cmd += install_rpm_data[i].file;
PopenStreams pos = Exec::safePopen(cmd.tokenize());
String output = pos.out()->readAll();
@@ -597,17 +576,16 @@
#endif
for(i = 0;i < (int) (sizeof(install_file_data) / sizeof(distro_file_t)); i++) {
#if LOCAL_DEBUG
- fprintf(stderr, "install_data: distro: %s\n", install_file_data[i].distro.c_str());
- fprintf(stderr, "install_data: file: %s\n", install_file_data[i].file.c_str());
+ fprintf(stderr, "install_data: distro: %s\n", install_file_data[i].distro);
+ fprintf(stderr, "install_data: file: %s\n", install_file_data[i].file);
#endif
- if(install_file_data[i].file.length()) {
+ if(strlen(install_file_data[i].file)) {
struct stat statbuf;
- if(::stat(install_file_data[i].file.c_str(), &statbuf) == 0) {
+ if(::stat(install_file_data[i].file, &statbuf) == 0) {
return CIMDateTime(DateTime((time_t) statbuf.st_mtime));
}
}
}
-#endif
return CIMDateTime();
} // LinuxOperatingSystem::getInstallDate()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|