projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use setpriority() instead of nice() on UNIX-like systems.
[tinc]
/
src
/
tincd.c
diff --git
a/src/tincd.c
b/src/tincd.c
index
a618e63
..
7758151
100644
(file)
--- 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 */
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 */
break;
case 'o': /* option */
@@
-500,12
+502,12
@@
static bool drop_privs() {
}
#ifdef HAVE_MINGW
}
#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
#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) {
#endif
int main(int argc, char **argv) {