X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=plugins%2Floopback.c;h=782853efe44b5b2ce37ff2206c51baf2cce2cf8d;hb=46b0ec36ec1ad1f130ecc5b99e9330158a9a283f;hp=deaaac271614d5fb4cf915e75a182fd584d5e9b8;hpb=4a6714894c506c1f4be0031dbc08662fca6a240c;p=connman diff --git a/plugins/loopback.c b/plugins/loopback.c index deaaac2..782853e 100644 --- a/plugins/loopback.c +++ b/plugins/loopback.c @@ -39,6 +39,7 @@ #include #include +#if 0 static GIOChannel *inotify_channel = NULL; static int hostname_descriptor = -1; @@ -133,6 +134,15 @@ static void remove_watch(void) close(fd); } +#endif + +static void create_hostname(void) +{ + const char *name = "localhost"; + + if (sethostname(name, strlen(name)) < 0) + connman_error("Failed to set hostname to %s", name); +} static int setup_hostname(void) { @@ -147,6 +157,8 @@ static int setup_hostname(void) if (strlen(name) > 0 && strcmp(name, "(none)") != 0) connman_info("System hostname is %s", name); + else + create_hostname(); memset(name, 0, sizeof(name)); @@ -233,14 +245,14 @@ static int loopback_init(void) setup_hostname(); - create_watch(); + //create_watch(); return 0; } static void loopback_exit(void) { - remove_watch(); + //remove_watch(); } CONNMAN_PLUGIN_DEFINE(loopback, "Loopback device plugin", VERSION,