Changeset 8348


Ignore:
Timestamp:
May 7, 2009, 1:05:10 AM (12 years ago)
Author:
charles
Message:

(trunk libT) add some testing messages for #2030... this dumps a lot of junk to the terminal and will be taken out as soon as there's some meaningful feedback in #2030

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r8308 r8348  
    470470    struct stat  sb;
    471471    int fd;
     472    ssize_t n;
    472473    const char * err_fmt = _( "Couldn't read \"%1$s\": %2$s" );
    473474
     
    481482        return NULL;
    482483    }
     484    tr_inf( "at the end of stat(%s), errno is %d", path, errno );
    483485
    484486    if( ( sb.st_mode & S_IFMT ) != S_IFREG )
     
    488490        return NULL;
    489491    }
     492    tr_inf( "looks like %s is a regular file... now we'll try to read it", path );
    490493
    491494    /* Load the torrent file into our buffer */
     
    498501        return NULL;
    499502    }
     503    tr_inf( "after trying to open the file for reading, fd is %d and errno is %d", fd, errno );
    500504    buf = malloc( sb.st_size + 1 );
    501505    if( !buf )
     
    507511        return NULL;
    508512    }
    509     if( read( fd, buf, sb.st_size ) != sb.st_size )
     513    n = read( fd, buf, sb.st_size );
     514    tr_inf( "file size is %"PRId64"; read is %"PRId64", errno is %d", (int64_t)sb.st_size, (int64_t)n, errno );
     515    if( n == -1 )
    510516    {
    511517        const int err = errno;
     
    517523    }
    518524
     525    tr_inf( "nearing the end, and errno is %d", errno );
    519526    tr_close_file( fd );
    520527    buf[ sb.st_size ] = '\0';
Note: See TracChangeset for help on using the changeset viewer.