mirror of
https://github.com/transmission/transmission
synced 2025-03-19 02:05:32 +00:00
(trunk libt) #3004 "Transmission doesn't report to the user errors when saving settings files" -- committed Longinus00's patch to trunk for 2.00
This commit is contained in:
parent
157707f93e
commit
83f97a35fe
3 changed files with 10 additions and 5 deletions
|
@ -500,10 +500,12 @@ loadProgress( tr_benc * dict,
|
|||
***/
|
||||
|
||||
void
|
||||
tr_torrentSaveResume( const tr_torrent * tor )
|
||||
tr_torrentSaveResume( tr_torrent * tor )
|
||||
{
|
||||
int err;
|
||||
tr_benc top;
|
||||
char * filename;
|
||||
char * filename;
|
||||
|
||||
|
||||
if( !tr_isTorrent( tor ) )
|
||||
return;
|
||||
|
@ -534,7 +536,8 @@ tr_torrentSaveResume( const tr_torrent * tor )
|
|||
saveRatioLimits( &top, tor );
|
||||
|
||||
filename = getResumeFilename( tor );
|
||||
tr_bencToFile( &top, TR_FMT_BENC, filename );
|
||||
if(( err = tr_bencToFile( &top, TR_FMT_BENC, filename )))
|
||||
tr_torrentSetLocalError( tor, "Unable to save resume file: %s", tr_strerror( err ) );
|
||||
tr_free( filename );
|
||||
|
||||
tr_bencFree( &top );
|
||||
|
|
|
@ -45,7 +45,7 @@ uint64_t tr_torrentLoadResume( tr_torrent * tor,
|
|||
uint64_t fieldsToLoad,
|
||||
const tr_ctor * ctor );
|
||||
|
||||
void tr_torrentSaveResume( const tr_torrent * tor );
|
||||
void tr_torrentSaveResume( tr_torrent * tor );
|
||||
|
||||
void tr_torrentRemoveResume( const tr_torrent * tor );
|
||||
|
||||
|
|
|
@ -696,7 +696,9 @@ torrentInit( tr_torrent * tor, const tr_ctor * ctor )
|
|||
if( !tr_ctorGetMetainfo( ctor, &val ) )
|
||||
{
|
||||
const char * path = tor->info.torrent;
|
||||
tr_bencToFile( val, TR_FMT_BENC, path );
|
||||
const int err = tr_bencToFile( val, TR_FMT_BENC, path );
|
||||
if( err )
|
||||
tr_torrentSetLocalError( tor, "Unable to save torrent file: %s", tr_strerror( err ) );
|
||||
tr_sessionSetTorrentFile( tor->session, tor->info.hashString, path );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue