[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: icecream/daemon
From: Stephan Kulow <coolo () kde ! org>
Date: 2007-04-26 17:23:18
Message-ID: 1177608198.211380.4128.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 658316 by coolo:
prepend os if it's not Linux (as in Mirko's fork)
M +23 -13 main.cpp
--- trunk/icecream/daemon/main.cpp #658315:658316
@@ -488,6 +488,7 @@
int handle_cs_conf( ConfCSMsg *msg);
string dump_internals() const;
string determine_nodename();
+ void determine_system();
bool maybe_stats(bool force = false);
bool send_scheduler(const Msg& msg) __attribute_warn_unused_result__;
void close_scheduler();
@@ -495,6 +496,27 @@
int working_loop();
};
+void Daemon::determine_system()
+{
+ struct utsname uname_buf;
+ if ( uname( &uname_buf ) ) {
+ log_perror( "uname call failed" );
+ return;
+ }
+
+ if ( nodename.length() && nodename != uname_buf.nodename )
+ custom_nodename = true;
+
+ if (!custom_nodename)
+ nodename = uname_buf.nodename;
+
+ string os = uname_buf.sysname;
+ if ( os != "Linux" )
+ machine_name = os + '_' + uname_buf.machine;
+ else // Linux
+ machine_name = uname_buf.machine;
+}
+
string Daemon::determine_nodename()
{
if (custom_nodename && !nodename.empty())
@@ -1592,20 +1614,8 @@
log_info() << "ICECREAM daemon " VERSION " starting up (nice level "
<< nice_level << ") " << endl;
- struct utsname uname_buf;
- if ( uname( &uname_buf ) ) {
- log_perror( "uname call failed" );
- return 1;
- }
+ d.determine_system();
- if ( d.nodename.length() && d.nodename != uname_buf.nodename )
- d.custom_nodename = true;
-
- if (!d.custom_nodename)
- d.nodename = uname_buf.nodename;
-
- d.machine_name = uname_buf.machine;
-
chdir( "/" );
if ( detach )
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic