From: Jordan Lee Date: Wed, 9 Feb 2011 05:42:52 +0000 (+0000) Subject: (trunk libt) silence a couple of identical compiler warnings: "ignoring return value... X-Git-Tag: 2.30b1~390 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2fc40f4b1ce044db51a8b88d3ff031d883fc061f;p=transmission (trunk libt) silence a couple of identical compiler warnings: "ignoring return value of ‘getcwd’, declared with attribute warn_unused_result". --- diff --git a/daemon/remote.c b/daemon/remote.c index ae86f0cb8..f09c0c0b8 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -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 ); } diff --git a/utils/create.c b/utils/create.c index 26279cf5d..a71521885 100644 --- a/utils/create.c +++ b/utils/create.c @@ -10,6 +10,7 @@ * $Id$ */ +#include #include #include /* 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 ); }