diff options
author | Fritz Elfert <felfert@to.com> | 2000-08-27 23:29:33 +0000 |
---|---|---|
committer | Fritz Elfert <felfert@to.com> | 2000-08-27 23:29:33 +0000 |
commit | d4b796119af628da552a64367557e31198c3f960 (patch) | |
tree | 80a28912868fabf80623b0b48ba4534f3a629988 /ncpd | |
parent | 457d55eb8081e27bd50ccb0c58e91412cd5c6d7f (diff) | |
download | plptools-d4b796119af628da552a64367557e31198c3f960.tar.gz plptools-d4b796119af628da552a64367557e31198c3f960.tar.bz2 plptools-d4b796119af628da552a64367557e31198c3f960.zip |
Programs now use an entry in /etc/services (if exists) for the TCP port.
Diffstat (limited to 'ncpd')
-rw-r--r-- | ncpd/main.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ncpd/main.cc b/ncpd/main.cc index ca1d2c4..a23267f 100644 --- a/ncpd/main.cc +++ b/ncpd/main.cc @@ -95,7 +95,6 @@ main(int argc, char **argv) bool dofork = true; bool autoexit = false; - // Command line parameter processing int sockNum = DPORT; int baudRate = DSPEED; const char *serialDevice = DDEV; @@ -103,6 +102,12 @@ main(int argc, char **argv) short int pverbose = 0; short int lverbose = 0; + struct servent *se = getservbyname("psion", "tcp"); + endservent(); + if (se != 0L) + sockNum = ntohs(se->s_port); + + // Command line parameter processing signal(SIGPIPE, SIG_IGN); for (int i = 1; i < argc; i++) { if (!strcmp(argv[i], "-p") && i + 1 < argc) { |