From 9d3394bd6a71229c395c7fe4e542c5c21cfc9362 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 19 Aug 2013 21:08:46 +0200 Subject: [SERVER] Formatting --- src/server/integrity.c | 4 +++- src/server/server.c | 21 ++++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/integrity.c b/src/server/integrity.c index beec81d..4e637f6 100644 --- a/src/server/integrity.c +++ b/src/server/integrity.c @@ -104,7 +104,9 @@ static void* integrity_main(void *data) size_t bufferSize = 0; setThreadName( "image-check" ); #if defined(linux) || defined(__linux) - // Setting nice of this thread - this is not POSIX conforming, so check if other platforms support this + // Setting nice of this thread - this is not POSIX conforming, so check if other platforms support this. + // POSIX says that setpriority() should set the nice value of all threads belonging to the current process, + // but on linux you can do this per thread. pid_t tid = syscall( SYS_gettid ); setpriority( PRIO_PROCESS, tid, 10 ); #endif diff --git a/src/server/server.c b/src/server/server.c index 2059c2e..6b1721b 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -178,11 +178,22 @@ int main(int argc, char *argv[]) int64_t paramSize = -1; int paramRevision = -1; static const char *optString = "c:d:nrsihv?"; - static const struct option longOpts[] = { { "config", required_argument, NULL, 'c' }, { "delay", required_argument, NULL, 'd' }, { - "nodaemon", no_argument, NULL, 'n' }, { "reload", no_argument, NULL, 'r' }, { "stop", no_argument, NULL, 's' }, { "info", - no_argument, NULL, 'i' }, { "help", no_argument, NULL, 'h' }, { "version", no_argument, NULL, 'v' }, { "crc", required_argument, - NULL, 'crc4' }, { "assert", no_argument, NULL, 'asrt' }, { "create", required_argument, NULL, 'crat' }, { "revision", - required_argument, NULL, 'rvid' }, { "size", required_argument, NULL, 'size' }, { 0, 0, 0, 0 } }; + static const struct option longOpts[] = { + { "config", required_argument, NULL, 'c' }, + { "delay", required_argument, NULL, 'd' }, + { "nodaemon", no_argument, NULL, 'n' }, + { "reload", no_argument, NULL, 'r' }, + { "stop", no_argument, NULL, 's' }, + { "info", no_argument, NULL, 'i' }, + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, 'v' }, + { "crc", required_argument, NULL, 'crc4' }, + { "assert", no_argument, NULL, 'asrt' }, + { "create", required_argument, NULL, 'crat' }, + { "revision", required_argument, NULL, 'rvid' }, + { "size", required_argument, NULL, 'size' }, + { 0, 0, 0, 0 } + }; opt = getopt_long( argc, argv, optString, longOpts, &longIndex ); -- cgit v1.2.3-55-g7522