41
41
#include "libqrexec-utils.h"
42
42
43
43
// whether qrexec-client should replace problematic bytes with _ before printing the output
44
- static int replace_chars_stdout = 0 ;
45
- static int replace_chars_stderr = 0 ;
44
+ static bool replace_chars_stdout = false ;
45
+ static bool replace_chars_stderr = false ;
46
46
47
47
static int exit_with_code = 1 ;
48
48
@@ -54,7 +54,7 @@ static int local_stdin_fd, local_stdout_fd;
54
54
static pid_t local_pid = 0 ;
55
55
/* flag if this is "remote" end of service call. In this case swap STDIN/STDOUT
56
56
* msg types and send exit code at the end */
57
- static int is_service = 0 ;
57
+ static bool is_service = false ;
58
58
59
59
static volatile sig_atomic_t sigchld = 0 ;
60
60
@@ -543,7 +543,7 @@ int main(int argc, char **argv)
543
543
int data_domain ;
544
544
int msg_type ;
545
545
int s ;
546
- int just_exec = 0 ;
546
+ bool just_exec = false ;
547
547
int wait_connection_end = 0 ;
548
548
char * local_cmdline = NULL ;
549
549
char * remote_cmdline = NULL ;
@@ -572,7 +572,7 @@ int main(int argc, char **argv)
572
572
local_cmdline = xstrdup (optarg );
573
573
break ;
574
574
case 'e' :
575
- just_exec = 1 ;
575
+ just_exec = true ;
576
576
break ;
577
577
case 'E' :
578
578
exit_with_code = 0 ;
@@ -583,13 +583,13 @@ int main(int argc, char **argv)
583
583
usage (argv [0 ]);
584
584
}
585
585
parse_connect (optarg , & request_id , & src_domain_name , & src_domain_id );
586
- is_service = 1 ;
586
+ is_service = true ;
587
587
break ;
588
588
case 't' :
589
- replace_chars_stdout = 1 ;
589
+ replace_chars_stdout = true ;
590
590
break ;
591
591
case 'T' :
592
- replace_chars_stderr = 1 ;
592
+ replace_chars_stderr = true ;
593
593
break ;
594
594
case 'w' :
595
595
connection_timeout = parse_int (optarg , "connection timeout" );
@@ -616,7 +616,7 @@ int main(int argc, char **argv)
616
616
617
617
register_exec_func (& do_exec );
618
618
619
- if (just_exec + (request_id != NULL ) + (local_cmdline != 0 ) > 1 ) {
619
+ if (just_exec + (request_id != NULL ) + (local_cmdline != NULL ) > 1 ) {
620
620
fprintf (stderr , "ERROR: only one of -e, -l, -c can be specified\n" );
621
621
usage (argv [0 ]);
622
622
}
0 commit comments