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 2012/06/20 00:15:00 UTC

svn commit: r1351883 - /incubator/mesos/trunk/src/common/logging.cpp

Author: benh
Date: Tue Jun 19 22:15:00 2012
New Revision: 1351883

URL: http://svn.apache.org/viewvc?rev=1351883&view=rev
Log:
Pass non-temporary string to InitGoogleLogging (contributed by Charles Reiess, https://reviews.apache.org/r/5423).

Modified:
    incubator/mesos/trunk/src/common/logging.cpp

Modified: incubator/mesos/trunk/src/common/logging.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/common/logging.cpp?rev=1351883&r1=1351882&r2=1351883&view=diff
==============================================================================
--- incubator/mesos/trunk/src/common/logging.cpp (original)
+++ incubator/mesos/trunk/src/common/logging.cpp Tue Jun 19 22:15:00 2012
@@ -50,7 +50,7 @@ void registerOptions(Configurator* confi
 }
 
 
-void initialize(const string& argv0, const Configuration& conf)
+void initialize(const string& _argv0, const Configuration& conf)
 {
   static process::Once initialized;
 
@@ -58,6 +58,10 @@ void initialize(const string& argv0, con
     return;
   }
 
+  // Persistent copy of argv0 since InitGoogleLogging requires the
+  // string we pass to it to be accessible indefinitely.
+  static string argv0 = _argv0;
+
   Option<string> directory = conf.get<string>("log_dir");
 
   // Set glog's parameters through Google Flags variables.