(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:
Jordan Lee 2011-02-09 05:42:52 +00:00
parent 3f9886c3dd
commit 2fc40f4b1c
2 changed files with 11 additions and 4 deletions

View File

@ -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 );
}

View File

@ -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 );
}