Changeset 10947


Ignore:
Timestamp:
Jul 5, 2010, 11:36:05 PM (12 years ago)
Author:
charles
Message:

(trunk daemon) #3394 "crash with last nightly build on Debian X86 #5189" -- fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/daemon.c

    r10783 r10947  
    4040#define PREF_KEY_DIR_WATCH          "watch-dir"
    4141#define PREF_KEY_DIR_WATCH_ENABLED  "watch-dir-enabled"
     42
     43#define MEM_K 1024
     44#define MEM_B_STR "B"
     45#define MEM_K_STR "KiB"
     46#define MEM_M_STR "MiB"
     47#define MEM_G_STR "GiB"
     48
     49#define DISK_K 1000
     50#define DISK_B_STR "B"
     51#define DISK_K_STR "kB"
     52#define DISK_M_STR "MB"
     53#define DISK_G_STR "GB"
     54
     55#define SPEED_K 1000
     56#define SPEED_B_STR "B/s"
     57#define SPEED_K_STR "kB/s"
     58#define SPEED_M_STR "MB/s"
     59#define SPEED_G_STR "GB/s"
    4260
    4361static tr_bool paused = FALSE;
     
    246264                    tr_err( "Error deleting .torrent file: %s", tr_strerror( errno ) );
    247265            }
     266            else
     267            {
     268                char * new_filename = tr_strdup_printf( "%s.added", filename );
     269                rename( filename, new_filename );
     270                tr_free( new_filename );
     271            }
    248272        }
    249273    }
     
    440464
    441465    /* start the session */
     466    tr_formatter_mem_init( MEM_K, MEM_B_STR, MEM_K_STR, MEM_M_STR, MEM_G_STR );
     467    tr_formatter_size_init( DISK_K,DISK_B_STR, DISK_K_STR, DISK_M_STR, DISK_G_STR );
     468    tr_formatter_speed_init( SPEED_K, SPEED_B_STR, SPEED_K_STR, SPEED_M_STR, SPEED_G_STR );
    442469    mySession = tr_sessionInit( "daemon", configDir, TRUE, &settings );
    443470    tr_ninf( NULL, "Using settings from \"%s\"", configDir );
Note: See TracChangeset for help on using the changeset viewer.