X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Ftincd.c;h=775815118b6486cc5ec70f56ad4c065c81f49f62;hp=a618e63f0d9158f78ba813b0efbb660599da8684;hb=cac0a5c651535e8317839b0deff1ee98086a8184;hpb=a08462bf845973016e061b8ca1233142d80416f6 diff --git a/src/tincd.c b/src/tincd.c index a618e63f..77581511 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -221,7 +221,9 @@ static bool parse_options(int argc, char **argv) { break; case 'n': /* net name given */ - netname = xstrdup(optarg); + /* netname "." is special: a "top-level name" */ + netname = strcmp(optarg, ".") != 0 ? + xstrdup(optarg) : NULL; break; case 'o': /* option */ @@ -500,12 +502,12 @@ static bool drop_privs() { } #ifdef HAVE_MINGW -# define setpriority(level) SetPriorityClass(GetCurrentProcess(), level) +# define setpriority(level) SetPriorityClass(GetCurrentProcess(), (level)) #else # define NORMAL_PRIORITY_CLASS 0 # define BELOW_NORMAL_PRIORITY_CLASS 10 # define HIGH_PRIORITY_CLASS -10 -# define setpriority(level) nice(level) +# define setpriority(level) (setpriority(PRIO_PROCESS, 0, (level))) #endif int main(int argc, char **argv) {