Changeset 11864


Ignore:
Timestamp:
Feb 9, 2011, 5:42:52 AM (12 years ago)
Author:
jordan
Message:

(trunk libt) silence a couple of identical compiler warnings: "ignoring return value of ‘getcwd’, declared with attribute warn_unused_result".

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/remote.c

    r11809 r11864  
    490490tr_getcwd( void )
    491491{
     492    char * result;
    492493    char buf[2048];
    493494    *buf = '\0';
    494495#ifdef WIN32
    495     _getcwd( buf, sizeof( buf ) );
     496    result = _getcwd( buf, sizeof( buf ) );
    496497#else
    497     getcwd( buf, sizeof( buf ) );
     498    result = getcwd( buf, sizeof( buf ) );
    498499#endif
     500    if( result == NULL )
     501        fprintf( stderr, "getcwd error: \"%s\"", tr_strerror( errno ) );
    499502    return tr_strdup( buf );
    500503}
  • trunk/utils/create.c

    r11709 r11864  
    1111 */
    1212
     13#include <errno.h>
    1314#include <stdio.h>
    1415#include <unistd.h> /* getcwd() */
     
    7879tr_getcwd( void )
    7980{
     81    char * result;
    8082    char buf[2048];
    8183    *buf = '\0';
    8284#ifdef WIN32
    83     _getcwd( buf, sizeof( buf ) );
     85    result = _getcwd( buf, sizeof( buf ) );
    8486#else
    85     getcwd( buf, sizeof( buf ) );
     87    result = getcwd( buf, sizeof( buf ) );
    8688#endif
     89    if( result == NULL )
     90        fprintf( stderr, "getcwd error: \"%s\"", tr_strerror( errno ) );
    8791    return tr_strdup( buf );
    8892}
Note: See TracChangeset for help on using the changeset viewer.