blob: 963d3dd4098847e970da8713064ff80063196539 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
$NetBSD: patch-aa,v 1.2 2004/03/06 17:32:11 xtraeme Exp $
--- src/State.cpp.orig 2004-03-06 18:20:58.000000000 +0100
+++ src/State.cpp 2004-03-06 18:22:07.000000000 +0100
@@ -151,10 +151,10 @@
debug( "GetUserName failed: %d.\n", iResult );
}
#else
- int iResult = getlogin_r( m_acNick, 127 );
+ int iResult = (int)getlogin();
if ( iResult )
{
- debug( "getlogin_r failed: %d\n", iResult );
+ debug( "getlogin failed: %d\n", iResult );
strcpy( m_acNick, getenv("USER") );
}
#endif
@@ -273,7 +273,11 @@
void SState::Save()
{
std::string sFilename = GetConfigFilename();
+#if defined(__GNUC__) && (__GNUC__ <= 2)
+ std::ofstream oStream( sFilename.c_str(), ios::out | ios::trunc );
+#else
std::ofstream oStream( sFilename.c_str(), std::ios_base::out | std::ios_base::trunc );
+#endif
if ( oStream.rdstate() & std::ios::failbit )
{
debug( "Unable to open config file: %s\n", sFilename.c_str() );
|