summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2021-03-16 15:45:06 +0000
committerMatthieu Herrb <matthieu@herrb.eu>2021-08-30 20:03:12 +0200
commit1fcb6c5a6ae7ea74dce1df3d4e205f7619170917 (patch)
tree9351dbf7af849b90c1ff90bf3e481b431abfa42f
parent8cd08e402eaf18de91d9b1f3ea1cfe808230602a (diff)
Fix confusion in boolean resources parsing.
This caused wrong resources values on big endian machines.
-rw-r--r--include/dm.h14
-rw-r--r--xenodm/resource.c12
2 files changed, 13 insertions, 13 deletions
diff --git a/include/dm.h b/include/dm.h
index a7ba732..4c58deb 100644
--- a/include/dm.h
+++ b/include/dm.h
@@ -98,11 +98,11 @@ struct display {
int startAttempts; /* number of attempts at starting */
int reservAttempts; /* allowed start-IO error sequences */
bool terminateServer;/* restart for each session */
- int grabServer; /* keep server grabbed for Login */
+ bool grabServer; /* keep server grabbed for Login */
int grabTimeout; /* time to wait for grab */
int resetSignal; /* signal to reset server */
int termSignal; /* signal to terminate server */
- int resetForAuth; /* server reads auth file at reset */
+ bool resetForAuth; /* server reads auth file at reset */
char *keymaps; /* binary compat with DEC */
/* session resources */
@@ -122,8 +122,8 @@ struct display {
char **authNames; /* authorization protocol names */
unsigned short *authNameLens; /* authorization protocol name lens */
char *clientAuthFile;/* client specified auth file */
- int authComplain; /* complain when no auth for XDMCP */
- int listenTcp; /* assume server is listening on TCP */
+ bool authComplain; /* complain when no auth for XDMCP */
+ bool listenTcp; /* assume server is listening on TCP */
/* information potentially derived from resources */
int authNameNum; /* number of protocol names */
@@ -179,10 +179,10 @@ extern char *servers;
extern int request_port;
extern int debugLevel;
extern char *errorLogFile;
-extern int daemonMode;
+extern bool daemonMode;
extern char *authDir;
-extern int autoRescan;
-extern int removeDomainname;
+extern bool autoRescan;
+extern bool removeDomainname;
extern char **exportList;
extern struct display *FindDisplayByName (char *name),
diff --git a/xenodm/resource.c b/xenodm/resource.c
index f1b220b..a079bb9 100644
--- a/xenodm/resource.c
+++ b/xenodm/resource.c
@@ -45,11 +45,11 @@ char *servers;
int request_port;
int debugLevel;
char *errorLogFile;
-int daemonMode;
-int sourceAddress;
+bool daemonMode;
+bool sourceAddress;
char *authDir;
-int autoRescan;
-int removeDomainname;
+bool autoRescan;
+bool removeDomainname;
char **exportList;
#define DM_STRING 0
@@ -267,11 +267,11 @@ GetResource (
if (!strcmp (str_buf, "true") ||
!strcmp (str_buf, "on") ||
!strcmp (str_buf, "yes"))
- *((int *) valuep) = 1;
+ *((bool *) valuep) = true;
else if (!strcmp (str_buf, "false") ||
!strcmp (str_buf, "off") ||
!strcmp (str_buf, "no"))
- *((int *) valuep) = 0;
+ *((bool *) valuep) = false;
break;
case DM_ARGV:
freeArgs (*(char ***) valuep);