mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-18 17:38:53 +02:00
Move -s and -c down a level so handling them is the responsibility of the command (with some helper functions), rather than the top-level. This changes the action command syntax so that -s and -c must be after the command rather than before.
This commit is contained in:
12
server.c
12
server.c
@@ -1,4 +1,4 @@
|
||||
/* $Id: server.c,v 1.45 2008-05-31 20:04:15 nicm Exp $ */
|
||||
/* $Id: server.c,v 1.46 2008-06-02 18:08:17 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@@ -62,6 +62,7 @@ server_start(const char *path)
|
||||
size_t size;
|
||||
mode_t mask;
|
||||
int n, fd, mode;
|
||||
char *cause;
|
||||
|
||||
switch (fork()) {
|
||||
case -1:
|
||||
@@ -109,6 +110,13 @@ server_start(const char *path)
|
||||
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
|
||||
fatal("fcntl failed");
|
||||
|
||||
/* Load configuration. */
|
||||
if (cfg_file != NULL && load_cfg(cfg_file, &cause) != 0) {
|
||||
log_warnx("%s", cause);
|
||||
xfree(cause);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (daemon(1, 1) != 0)
|
||||
fatal("daemon failed");
|
||||
log_debug("server daemonised, pid now %ld", (long) getpid());
|
||||
@@ -135,7 +143,7 @@ server_main(const char *srv_path, int srv_fd)
|
||||
ARRAY_INIT(&sessions);
|
||||
|
||||
key_bindings_init();
|
||||
|
||||
|
||||
pfds = NULL;
|
||||
while (!sigterm) {
|
||||
/* Initialise pollfd array. */
|
||||
|
Reference in New Issue
Block a user