ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/HostStatus/HostStatus.hpp
(Generate patch)

Comparing HostStatus/HostStatus.hpp (file contents):
Revision 29 by Douglas Thrift, 2003-11-14T12:44:58-08:00 vs.
Revision 33 by Douglas Thrift, 2003-11-15T00:38:48-08:00

# Line 7 | Line 7
7   #ifndef _HostStatus_hpp_
8   #define _HostStatus_hpp_
9  
10 + #define _BSD_SOURCE
11 +
12   #include <iostream>
13   #include <string>
14   #include <sstream>
# Line 26 | Line 28 | inline string sgetenv(const string& name
28          return value != NULL ? value : "";
29   }
30  
31 < inline int sputenv(const string& name) { return putenv(name.c_str()); }
31 > inline int sputenv(const string& name)
32 > {
33 >        char* value = new char[name.size() + 1];
34 >
35 >        sprintf(value, name.c_str());
36 >        
37 >        int code = putenv(value);
38 >
39 >        return code;
40 > }
41 >
42   inline void sunsetenv(const string& name) { unsetenv(name.c_str()); }
43  
44   class HostStatus

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines