Switch to unified view

a/src/upmpd.cxx b/src/upmpd.cxx
...
...
388
388
389
    if (g_sc2mpd_path.empty()) {
389
    if (g_sc2mpd_path.empty()) {
390
        // Do we have an sc2mpd command installed (for songcast)?
390
        // Do we have an sc2mpd command installed (for songcast)?
391
        if (!ExecCmd::which("sc2mpd", g_sc2mpd_path))
391
        if (!ExecCmd::which("sc2mpd", g_sc2mpd_path))
392
            g_sc2mpd_path.clear();
392
            g_sc2mpd_path.clear();
393
    } else {
394
        if (access(g_sc2mpd_path.c_str(), X_OK|R_OK) != 0) {
395
            LOGERR("Specified path for sc2mpd: " << g_sc2mpd_path << 
396
                   " is not executable" << endl);
397
            g_sc2mpd_path.clear();
398
        }
399
    }
393
    }
400
394
401
    Pidfile pidfile(pidfilename);
395
    Pidfile pidfile(pidfilename);
402
396
403
    // If started by root, do the pidfile + change uid thing
397
    // If started by root, do the pidfile + change uid thing
...
...
469
                   << endl);
463
                   << endl);
470
            return 1;
464
            return 1;
471
        }
465
        }
472
    }
466
    }
473
467
468
//// Dropped root 
469
470
    if (!g_sc2mpd_path.empty()) {
471
        if (access(g_sc2mpd_path.c_str(), X_OK|R_OK) != 0) {
472
            LOGERR("Specified path for sc2mpd: " << g_sc2mpd_path << 
473
                   " is not executable" << endl);
474
            g_sc2mpd_path.clear();
475
        }
476
    }
477
474
    // Initialize MPD client object. Retry until it works or power fail.
478
    // Initialize MPD client object. Retry until it works or power fail.
475
    MPDCli *mpdclip = 0;
479
    MPDCli *mpdclip = 0;
476
    int mpdretrysecs = 2;
480
    int mpdretrysecs = 2;
477
    for (;;) {
481
    for (;;) {
478
        mpdclip = new MPDCli(mpdhost, mpdport, mpdpassword);
482
        mpdclip = new MPDCli(mpdhost, mpdport, mpdpassword);