Name: net-config
Summary: TIZEN Network Configuration Module
-Version: 0.1.90_26
+Version: 0.1.90_27
Release: 1
Group: System/Network
License: Apache License Version 2.0
BuildRequires: pkgconfig(tapi)
BuildRequires: pkgconfig(syspopup-caller)
Requires(post): /usr/bin/vconftool
-Requires: systemd
-Requires(post): systemd
-Requires(preun): systemd
-Requires(postun): systemd
+BuildRequires: pkgconfig(libsystemd-daemon)
+%{?systemd_requires}
%description
TIZEN Network Configuration Module
*
*/
+#include <systemd/sd-daemon.h>
+#include <getopt.h>
#include <unistd.h>
+#include <signal.h>
+#include <errno.h>
#include "log.h"
#include "wifi.h"
static GMainLoop *main_loop = NULL;
+static int no_fork = FALSE;
+
+int netconfig_test_input_parameters(int argc, char* argv[])
+{
+ struct option tab[] = {
+ { "nofork", no_argument, 0, 0 },
+ { NULL, 0, NULL, 0 }
+ };
+ int idx = 0;
+
+ while (getopt_long(argc, argv, "", tab, &idx) >= 0) {
+
+ if (idx == 0)
+ no_fork = TRUE;
+ idx = 0;
+ }
+ return 0;
+}
+
int main(int argc, char* argv[])
{
DBusGConnection *connection;
DBG("Network Configuration Module");
- if (daemon(0, 0) != 0)
- DBG("Cannot start daemon");
+ /*
+ * Call parameters veryfication
+ */
+ netconfig_test_input_parameters(argc, argv);
+
+ if (!no_fork) {
+ if (daemon(0, 0) != 0)
+ DBG("Cannot start daemon");
+ }
netconfig_set_wifi_mac_address();
/* If its environment uses Emulator, network configuration is set by emulator default */
netconfig_emulator_test_and_start();
+ // Notyfication to systemd
+ sd_notify(0, "READY=1");
+
g_main_loop_run(main_loop);
netconfig_deregister_signal();