diff options
author | midipix <writeonce@midipix.org> | 2016-08-18 04:51:06 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-08-18 11:18:33 -0400 |
commit | 690c8cefb49c228ad88230596485269627ac3141 (patch) | |
tree | f0c725b7b46db8dbb115339c102a03cb7ea84da7 | |
parent | 16c3a668228f843fb995c75dfffe5e291259eae0 (diff) | |
download | ptycon-690c8cefb49c228ad88230596485269627ac3141.tar.bz2 ptycon-690c8cefb49c228ad88230596485269627ac3141.tar.xz |
driver: exit as needed after version printing.
-rw-r--r-- | include/ptycon/ptycon.h | 4 | ||||
-rw-r--r-- | src/driver/ptyc_amain.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/ptycon/ptycon.h b/include/ptycon/ptycon.h index 19c2513..d8f2275 100644 --- a/include/ptycon/ptycon.h +++ b/include/ptycon/ptycon.h @@ -48,6 +48,10 @@ extern "C" { #define PTYC_DRIVER_DAEMON_ALWAYS 0x1000 #define PTYC_DRIVER_DAEMON_NEVER 0x2000 +#define PTYC_DRIVER_DBG_MODE (PTYC_DRIVER_DBG_EVENT \ + | PTYC_DRIVER_DBG_OVEN \ + | PTYC_DRIVER_DBG_RAW) + struct ptyc_source_version { int major; int minor; diff --git a/src/driver/ptyc_amain.c b/src/driver/ptyc_amain.c index ecdc651..a257bf7 100644 --- a/src/driver/ptyc_amain.c +++ b/src/driver/ptyc_amain.c @@ -70,6 +70,10 @@ int ptyc_main(int argc, char ** argv, char ** envp) if ((ptyc_version(dctx)) < 0) return ptyc_exit(dctx,2); + if (!dctx->cctx->eargv) + if (!(dctx->cctx->drvflags & PTYC_DRIVER_DBG_MODE)) + return ptyc_exit(dctx,0); + if (ptyc_alloc_pty(dctx)) return ptyc_exit(dctx,2); |