Switch to unified view

a/scctl_src/scctl.cpp b/scctl_src/scctl.cpp
...
...
50
#include <algorithm>
50
#include <algorithm>
51
51
52
#include "libupnpp/upnpplib.hxx"
52
#include "libupnpp/upnpplib.hxx"
53
#include "libupnpp/log.hxx"
53
#include "libupnpp/log.hxx"
54
#include "libupnpp/control/linnsongcast.hxx"
54
#include "libupnpp/control/linnsongcast.hxx"
55
#include "libupnpp/control/discovery.hxx"
55
56
56
#include "../src/netcon.h"
57
#include "../src/netcon.h"
57
#include "../src/smallut.h"
58
#include "../src/smallut.h"
58
#include "../src/upmpdutils.hxx"
59
#include "../src/upmpdutils.hxx"
59
60
...
...
250
    vector<string> args;
251
    vector<string> args;
251
    while (optind < argc) {
252
    while (optind < argc) {
252
        args.push_back(argv[optind++]);
253
        args.push_back(argv[optind++]);
253
    }
254
    }
254
255
256
    ret = 0;
255
    if ((op_flags & OPT_S)) {
257
    if ((op_flags & OPT_S)) {
256
        exit(runserver());
258
        ret = runserver();
259
        goto exitprog;
257
    } else {
260
    } else {
258
        string out;
261
        string out;
259
        if (dosomething(op_flags, args, out)) {
262
        if (dosomething(op_flags, args, out)) {
260
            Usage();
263
            Usage();
261
        }
264
        }
...
...
267
    // this instead (and not incur the discovery timeout)
270
    // this instead (and not incur the discovery timeout)
268
    if ((op_flags & OPT_f)) {
271
    if ((op_flags & OPT_f)) {
269
        // Father exits, son process becomes server
272
        // Father exits, son process becomes server
270
        if (daemon(0, 0) == 0)
273
        if (daemon(0, 0) == 0)
271
            runserver();
274
            runserver();
272
    } 
275
    }
276
exitprog:
277
    UPnPDeviceDirectory *dir = UPnPDeviceDirectory::getTheDir();
278
    if (dir) {
279
        dir->terminate();
280
    }
273
    return 0;
281
    return ret;
274
}
282
}
275
283
276
284
277
// The Unix socket path which we use for client-server operation
285
// The Unix socket path which we use for client-server operation
278
bool sockname(string& nm)
286
bool sockname(string& nm)