(trunk libt) silence a couple of identical compiler warnings: "ignoring return value of ‘getcwd’, declared with attribute warn_unused_result".
This commit is contained in:
parent
3f9886c3dd
commit
2fc40f4b1c
|
@ -489,13 +489,16 @@ static char * sessionId = NULL;
|
|||
static char*
|
||||
tr_getcwd( void )
|
||||
{
|
||||
char * result;
|
||||
char buf[2048];
|
||||
*buf = '\0';
|
||||
#ifdef WIN32
|
||||
_getcwd( buf, sizeof( buf ) );
|
||||
result = _getcwd( buf, sizeof( buf ) );
|
||||
#else
|
||||
getcwd( buf, sizeof( buf ) );
|
||||
result = getcwd( buf, sizeof( buf ) );
|
||||
#endif
|
||||
if( result == NULL )
|
||||
fprintf( stderr, "getcwd error: \"%s\"", tr_strerror( errno ) );
|
||||
return tr_strdup( buf );
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
* $Id$
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h> /* getcwd() */
|
||||
|
||||
|
@ -77,13 +78,16 @@ parseCommandLine( int argc, const char ** argv )
|
|||
static char*
|
||||
tr_getcwd( void )
|
||||
{
|
||||
char * result;
|
||||
char buf[2048];
|
||||
*buf = '\0';
|
||||
#ifdef WIN32
|
||||
_getcwd( buf, sizeof( buf ) );
|
||||
result = _getcwd( buf, sizeof( buf ) );
|
||||
#else
|
||||
getcwd( buf, sizeof( buf ) );
|
||||
result = getcwd( buf, sizeof( buf ) );
|
||||
#endif
|
||||
if( result == NULL )
|
||||
fprintf( stderr, "getcwd error: \"%s\"", tr_strerror( errno ) );
|
||||
return tr_strdup( buf );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue