Changeset 3988
- Timestamp:
- Nov 26, 2007, 8:37:07 PM (15 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/inout.c
r3918 r3988 28 28 #include "platform.h" 29 29 #include "peer-mgr.h" 30 #include "stats.h" 30 31 #include "utils.h" 31 32 … … 56 57 int fd = -1; 57 58 int ret; 59 int fileExists; 58 60 59 61 assert( 0<=fileIndex && fileIndex<info->fileCount ); … … 62 64 63 65 tr_buildPath ( path, sizeof(path), tor->destination, file->name, NULL ); 66 fileExists = !stat( path, &sb ); 64 67 65 68 if( !file->length ) 66 69 return 0; 67 else if ((ioMode==TR_IO_READ) && stat( path, &sb )) /* does file exist? */70 else if ((ioMode==TR_IO_READ) && !fileExists ) /* does file exist? */ 68 71 ret = tr_ioErrorFromErrno (); 69 72 else if ((fd = tr_fdFileCheckout ( path, ioMode==TR_IO_WRITE )) < 0) … … 75 78 else 76 79 ret = TR_OK; 80 81 if((ret==TR_OK) && (ioMode==TR_IO_WRITE) && !fileExists ) 82 tr_statsFileCreated( tor->handle ); 77 83 78 84 if( fd >= 0 ) -
trunk/libtransmission/stats.c
r3987 r3988 174 174 175 175 void 176 tr_ torrentAdded( tr_handle * handle, const tr_torrent * torrent)176 tr_statsFileCreated( tr_handle * handle ) 177 177 { 178 178 struct tr_stats_handle * stats = handle->sessionStats; 179 stats->cumulative.filesAdded += torrent->info.fileCount;180 stats->single.filesAdded += torrent->info.fileCount;179 ++stats->cumulative.filesAdded; 180 ++stats->single.filesAdded; 181 181 } -
trunk/libtransmission/stats.h
r3983 r3988 22 22 void tr_statsAddDownloaded( tr_handle * handle, uint32_t bytes ); 23 23 24 void tr_ torrentAdded( tr_handle * handle, const tr_torrent * torrent);24 void tr_statsFileCreated( tr_handle * handle ); 25 25 26 26 #endif
Note: See TracChangeset
for help on using the changeset viewer.