Changeset 857
- Timestamp:
- Jan 25, 2008 9:00:53 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/RpLibrary.cc
r808 r857 2210 2210 std::string timestamp = ""; 2211 2211 std::string username = ""; 2212 std::string hostname = ""; 2213 char *user = NULL; 2214 char *host = NULL; 2212 2215 2213 2216 if (this->root) { … … 2233 2236 // how to retrieve username on win32 environment. 2234 2237 username = ""; 2238 hostname = ""; 2235 2239 #else 2236 2240 timestamp.append(timeinfo->tm_zone); 2237 username = std::string(getenv("USER")); 2241 user = getenv("USER"); 2242 if (user != NULL) { 2243 username = std::string(user); 2244 } 2245 host = getenv("HOST"); 2246 if (host != NULL) { 2247 hostname = std::string(host); 2248 } 2238 2249 #endif 2239 2250 … … 2242 2253 put("output.status",exitStatus); 2243 2254 put("output.user",username); 2255 put("output.host",hostname); 2244 2256 2245 2257 if ( file.is_open() ) {
Note: See TracChangeset
for help on using the changeset viewer.