Changeset 11864 for trunk/utils/create.c


Ignore:
Timestamp:
Feb 9, 2011, 5:42:52 AM (11 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".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.