You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2011/06/05 07:43:29 UTC
svn commit: r1131875 - in /incubator/mesos/trunk/src: master_main.cpp
master_webui.cpp
Author: benh
Date: Sun Jun 5 05:43:28 2011
New Revision: 1131875
URL: http://svn.apache.org/viewvc?rev=1131875&view=rev
Log:
Minor bug fixes.
Modified:
incubator/mesos/trunk/src/master_main.cpp
incubator/mesos/trunk/src/master_webui.cpp
Modified: incubator/mesos/trunk/src/master_main.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/master_main.cpp?rev=1131875&r1=1131874&r2=1131875&view=diff
==============================================================================
--- incubator/mesos/trunk/src/master_main.cpp (original)
+++ incubator/mesos/trunk/src/master_main.cpp Sun Jun 5 05:43:28 2011
@@ -96,10 +96,14 @@ int main (int argc, char **argv)
if (chdir(dirname(argv[0])) != 0)
fatalerror("Could not change into %s for running webui.\n", dirname(argv[0]));
+ // TODO(*): Since we normally don't use exceptions in Mesos, replace
+ // use of an exception here with use of a utility to handle checking
+ // that the input string is actually a number that fits
+ // in the type being used (in this case, short).
try {
lexical_cast<short>(webuiPortStr);
} catch(bad_lexical_cast &) {
- fatalerror("Passed invalid string for webui port number.\n");
+ fatal("Passed invalid string for webui port number.\n");
}
startMasterWebUI(pid, webuiPortStr);
Modified: incubator/mesos/trunk/src/master_webui.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/master_webui.cpp?rev=1131875&r1=1131874&r2=1131875&view=diff
==============================================================================
--- incubator/mesos/trunk/src/master_webui.cpp (original)
+++ incubator/mesos/trunk/src/master_webui.cpp Sun Jun 5 05:43:28 2011
@@ -25,7 +25,7 @@ void *runMasterWebUI(void* webuiPort)
Py_Initialize();
char* nargv[2];
nargv[0] = const_cast<char*>("webui/master/webui.py");
- nargv[1] = (char*)webuiPort;
+ nargv[1] = reinterpret_cast<char*>(webuiPort);
PySys_SetArgv(2,nargv);
PyRun_SimpleString("import sys\n"
"sys.path.append('webui/master/swig')\n"
@@ -45,7 +45,7 @@ void startMasterWebUI(const PID &master,
LOG(INFO) << "Starting master web UI";
::master = master;
pthread_t thread;
- pthread_create(&thread, 0, runMasterWebUI, (void*)webuiPort);
+ pthread_create(&thread, 0, runMasterWebUI, webuiPort);
}