[DEV] add auto set of the binary as default application name
This commit is contained in:
parent
33d985fcac
commit
d56c8b57c7
@ -1,8 +1,6 @@
|
||||
/** @file
|
||||
* @author Edouard DUPIN
|
||||
*
|
||||
* @copyright 2011, Edouard DUPIN, all right reserved
|
||||
*
|
||||
* @license APACHE v2.0 (see license file)
|
||||
*/
|
||||
|
||||
@ -14,7 +12,7 @@
|
||||
#include <etk/os/FSNode.h>
|
||||
|
||||
void etk::init(int _argc, const char** _argv) {
|
||||
TK_INFO("E-TK system init (BEGIN)");
|
||||
TK_INFO("E-TK system init (BEGIN) " << _argv[0]);
|
||||
elog::init(_argc, _argv);
|
||||
etk::setArgZero(_argv[0]);
|
||||
for (int32_t iii=0; iii<_argc ; ++iii) {
|
||||
|
@ -1,8 +1,6 @@
|
||||
/** @file
|
||||
* @author Edouard DUPIN
|
||||
*
|
||||
* @copyright 2011, Edouard DUPIN, all right reserved
|
||||
*
|
||||
* @license APACHE v2.0 (see license file)
|
||||
*/
|
||||
|
||||
@ -215,6 +213,9 @@ std::string l_argZero = "";
|
||||
void etk::setArgZero(const std::string& _val) {
|
||||
std::unique_lock<std::mutex> lock(getNodeMutex());
|
||||
l_argZero = _val;
|
||||
// set defaiult application name ...
|
||||
std::vector<std::string> elems = etk::split(_val, '/');
|
||||
etk::initDefaultFolder(elems[elems.size()-1].c_str());
|
||||
}
|
||||
/*
|
||||
On Unixes with /proc really straight and realiable way is to:
|
||||
|
Loading…
x
Reference in New Issue
Block a user