~ubuntu-branches/ubuntu/trusty/sflphone/trusty

« back to all changes in this revision

Viewing changes to daemon/src/main.cpp

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (4.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20140128182336-jrsv0k9u6cawc068
Tags: 1.3.0-1
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
 
2
 *  Copyright (C) 2004-2013 Savoir-Faire Linux Inc.
3
3
 *  Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>
4
4
 *  Author: Yan Morin <yan.morin@savoirfairelinux.com>
5
5
 *  Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com>
35
35
#endif
36
36
 
37
37
#include <iostream>
 
38
#include <signal.h>
38
39
#include <getopt.h>
39
40
#include "fileutils.h"
40
41
#include "logger.h"
44
45
    void print_title()
45
46
    {
46
47
        std::cout << "SFLphone Daemon " << VERSION <<
47
 
            ", by Savoir-Faire Linux 2004-2012" << std::endl <<
 
48
            ", by Savoir-Faire Linux 2004-2014" << std::endl <<
48
49
            "http://www.sflphone.org/" << std::endl;
49
50
    }
50
51
 
124
125
namespace {
125
126
    void signal_handler(int code)
126
127
    {
 
128
        // Unset signal handlers
 
129
        signal(SIGHUP, SIG_DFL);
 
130
        signal(SIGINT, SIG_DFL);
 
131
        signal(SIGTERM, SIG_DFL);
 
132
 
127
133
        std::cerr << "Caught signal " << strsignal(code) << ", terminating..." << std::endl;
128
 
        Manager::instance().finish();
 
134
        Manager::instance().interrupt();
129
135
    }
130
136
}
131
137
 
143
149
    std::vector<char> writable(programName.size() + 1);
144
150
    std::copy(programName.begin(), programName.end(), writable.begin());
145
151
 
146
 
    fileutils::set_program_dir(&*writable.begin());
 
152
    fileutils::set_program_dir(writable.data());
147
153
 
148
154
    print_title();
149
155
    if (parse_args(argc, argv))
167
173
        return 1;
168
174
    }
169
175
 
 
176
    int ret = 0;
170
177
#ifdef SFL_VIDEO
171
178
    WARN("Built with video support");
172
179
#endif
173
 
 
174
 
    Manager::instance().run();
175
 
    Manager::instance().saveHistory();
176
 
 
177
 
    return 0;
 
180
#if HAVE_DBUS
 
181
    ret = Manager::instance().run();
 
182
#endif
 
183
    Manager::instance().finish();
 
184
 
 
185
    return ret;
178
186
}