]> granicus.if.org Git - transmission/commitdiff
(trunk libt) silence a couple of identical compiler warnings: "ignoring return value...
authorJordan Lee <jordan@transmissionbt.com>
Wed, 9 Feb 2011 05:42:52 +0000 (05:42 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Wed, 9 Feb 2011 05:42:52 +0000 (05:42 +0000)
daemon/remote.c
utils/create.c

index ae86f0cb8befec71160e0c224b6fd892fa7af0cc..f09c0c0b89b1a5d866d421aafec3fdabc55eb4ed 100644 (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 );
 }
 
index 26279cf5d57a96ccdc07397193e551bad617f8f8..a715218852ceb8120f91f418c16623bd3e941f3b 100644 (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 );
 }