summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2013-08-19 21:08:46 +0200
committerSimon Rettberg2013-08-19 21:08:46 +0200
commit9d3394bd6a71229c395c7fe4e542c5c21cfc9362 (patch)
treeb270550d620c7b0bd57e5718ddae7c106f0aece3
parent[CLIENT] Start implementing a daemon mode which should make connecting dnbd3 ... (diff)
downloaddnbd3-9d3394bd6a71229c395c7fe4e542c5c21cfc9362.tar.gz
dnbd3-9d3394bd6a71229c395c7fe4e542c5c21cfc9362.tar.xz
dnbd3-9d3394bd6a71229c395c7fe4e542c5c21cfc9362.zip
[SERVER] Formatting
-rw-r--r--src/server/integrity.c4
-rw-r--r--src/server/server.c21
2 files changed, 19 insertions, 6 deletions
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 );