version 1.183, 2017/07/03 08:08:30 |
version 1.184, 2017/07/12 09:21:25 |
|
|
struct timeval start_time; |
struct timeval start_time; |
const char *socket_path; |
const char *socket_path; |
int ptm_fd = -1; |
int ptm_fd = -1; |
|
const char *shell_command; |
|
|
static __dead void usage(void); |
static __dead void usage(void); |
static char *make_label(const char *); |
static char *make_label(const char *); |
|
|
int |
int |
main(int argc, char **argv) |
main(int argc, char **argv) |
{ |
{ |
char *path, *label, tmp[PATH_MAX]; |
char *path, *label, **var; |
char *shellcmd = NULL, **var; |
char tmp[PATH_MAX]; |
const char *s, *shell; |
const char *s, *shell; |
int opt, flags, keys; |
int opt, flags, keys; |
const struct options_table_entry *oe; |
const struct options_table_entry *oe; |
|
|
flags |= CLIENT_256COLOURS; |
flags |= CLIENT_256COLOURS; |
break; |
break; |
case 'c': |
case 'c': |
free(shellcmd); |
shell_command = optarg; |
shellcmd = xstrdup(optarg); |
|
break; |
break; |
case 'C': |
case 'C': |
if (flags & CLIENT_CONTROL) |
if (flags & CLIENT_CONTROL) |
|
|
argc -= optind; |
argc -= optind; |
argv += optind; |
argv += optind; |
|
|
if (shellcmd != NULL && argc != 0) |
if (shell_command != NULL && argc != 0) |
usage(); |
usage(); |
|
|
if ((ptm_fd = getptmfd()) == -1) |
if ((ptm_fd = getptmfd()) == -1) |
|
|
free(label); |
free(label); |
|
|
/* Pass control to the client. */ |
/* Pass control to the client. */ |
exit(client_main(event_init(), argc, argv, flags, shellcmd)); |
exit(client_main(event_init(), argc, argv, flags)); |
} |
} |