Changeset 10968


Ignore:
Timestamp:
Jul 7, 2010, 6:49:06 PM (12 years ago)
Author:
charles
Message:

(trunk daemon) #3401 "can't set pid option on daemon in settings.json" -- fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/daemon.c

    r10955 r10968  
    4040#define PREF_KEY_DIR_WATCH          "watch-dir"
    4141#define PREF_KEY_DIR_WATCH_ENABLED  "watch-dir-enabled"
     42#define PREF_KEY_PIDFILE            "pidfile"
    4243
    4344#define MEM_K 1024
     
    6465static tr_bool closing = FALSE;
    6566static tr_session * mySession = NULL;
    66 static const char * pid_filename = NULL;
    6767
    6868/***
     
    334334    tr_bool dumpSettings = FALSE;
    335335    const char * configDir = NULL;
     336    const char * pid_filename;
    336337    dtr_watchdir * watchdir = NULL;
    337338    FILE * logfile = NULL;
     
    429430            case 954: tr_bencDictAddBool( &settings, TR_PREFS_KEY_RATIO_ENABLED, FALSE );
    430431                      break;
    431             case 'x': pid_filename = optarg;
     432            case 'x': tr_bencDictAddStr( &settings, PREF_KEY_PIDFILE, optarg );
    432433                      break;
    433434            case 'y': tr_bencDictAddBool( &settings, TR_PREFS_KEY_LPD_ENABLED, TRUE );
     
    473474    tr_sessionSaveSettings( mySession, configDir, &settings );
    474475
     476    pid_filename = NULL;
     477    tr_bencDictFindStr( &settings, PREF_KEY_PIDFILE, &pid_filename );
    475478    if( pid_filename != NULL )
    476479    {
Note: See TracChangeset for help on using the changeset viewer.