aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Args.c
diff options
context:
space:
mode:
authorMihai Moldovan <ïonic@ionic.de>2016-06-17 01:45:40 +0000
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-06-21 04:06:27 +0200
commit4d6d3c56706e0c5a0725c13356c28d3655f72cac (patch)
treebc82daeb0090eea8dc7eb977cc82a3ed47284262 /nx-X11/programs/Xserver/hw/nxagent/Args.c
parent04d2fe3aef464560de16d5b15ed91f8d63c6fb09 (diff)
downloadnx-libs-4d6d3c56706e0c5a0725c13356c28d3655f72cac.tar.gz
nx-libs-4d6d3c56706e0c5a0725c13356c28d3655f72cac.tar.bz2
nx-libs-4d6d3c56706e0c5a0725c13356c28d3655f72cac.zip
{nx-X11/programs/Xserver/hw/nxagent/{{Args,Handlers,Image,Options}.c,Options.h},nxcomp/{Loop,Misc}.cpp}: add configurable sleep delay if session is suspended.
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Args.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Args.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c
index 59d3deb63..2590dd6c3 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c
@@ -1339,6 +1339,44 @@ static void nxagentParseOptions(char *name, char *value)
nxagentChangeOption(Clipboard, ClipboardBoth);
}
}
+ else if (!strcmp(name, "sleep"))
+ {
+ long sleep_parse = 0;
+
+ errno = 0;
+ sleep_parse = strtol(value, NULL, 10);
+
+ if ((errno) && (0 == sleep_parse))
+ {
+ fprintf(stderr, "nxagentParseOptions: Unable to convert value [%s] of option [%s]. "
+ "Ignoring option.\n",
+ validateString(value), validateString(name));
+
+ return;
+ }
+
+ if ((long) UINT_MAX < sleep_parse)
+ {
+ sleep_parse = UINT_MAX;
+
+ fprintf(stderr, "nxagentParseOptions: Warning: value [%s] of option [%s] "
+ "out of range, clamped to [%u].\n",
+ validateString(value), validateString(name), sleep_parse);
+ }
+
+ if (0 > sleep_parse)
+ {
+ sleep_parse = 0;
+
+ fprintf(stderr, "nxagentParseOptions: Warning: value [%s] of option [%s] "
+ "out of range, clamped to [%u].\n",
+ validateString(value), validateString(name), sleep_parse);
+ }
+
+ nxagentChangeOption(SleepTime, sleep_parse);
+
+ return;
+ }
else
{
#ifdef DEBUG