From owner-freebsd-isdn Fri Nov 23 2:43:57 2001 Delivered-To: freebsd-isdn@freebsd.org Received: from fepD.post.tele.dk (fepD.post.tele.dk [195.41.46.149]) by hub.freebsd.org (Postfix) with ESMTP id 422D937B418 for ; Fri, 23 Nov 2001 02:43:53 -0800 (PST) Received: from arnold.neland.dk ([62.243.77.140]) by fepD.post.tele.dk (InterMail vM.4.01.03.23 201-229-121-123-20010418) with ESMTP id <20011123104348.KGFT16766.fepD.post.tele.dk@arnold.neland.dk> for ; Fri, 23 Nov 2001 11:43:48 +0100 Received: from localhost (localhost [127.0.0.1]) by arnold.neland.dk (8.11.6/8.11.6) with ESMTP id fANAi5q21823 for ; Fri, 23 Nov 2001 11:44:05 +0100 (CET) (envelope-from leifn@neland.dk) Date: Fri, 23 Nov 2001 11:44:05 +0100 (CET) From: Leif Neland To: Subject: isdnd -P : why initialize hw etc? In-Reply-To: <20001126154033.45CF83E8@hcswork.hcs.de> Message-ID: <20011123105454.G12686-100000@arnold.neland.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-isdn@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I looked at isdnd/main.c, and I wonder why isdnd -P try to connect to hw, why does it do more than parse the config-file, print it and exit? Is it nessecary to run this: check_pid(); /* check if we are already running */ /* open isdn device */ if((isdnfd = open(I4BDEVICE, O_RDWR)) < 0) { log(LL_ERR, "main: cannot open %s: %s", I4BDEVICE, strerror(errno)); exit(1); } /* check kernel and userland have same version/release numbers */ if((ioctl(isdnfd, I4B_VR_REQ, &mvr)) < 0) { log(LL_ERR, "main: ioctl I4B_VR_REQ failed: %s", strerror(errno)); do_exit(1); } if(mvr.version != VERSION) { log(LL_ERR, "main: version mismatch, kernel %d, daemon %d", mvr.version, VERSION); do_exit(1); } if(mvr.release != REL) { log(LL_ERR, "main: release mismatch, kernel %d, daemon %d", mvr.release, REL); do_exit(1); } if(mvr.step != STEP) { log(LL_ERR, "main: step mismatch, kernel %d, daemon %d", mvr.step, STEP); do_exit(1); } /* init controller state array */ init_controller(); /* read runtime configuration file and configure ourselves */ If -P is set, configure never returns, but isdnd terminates. configure(configfile, 0); Why not put all the above statements in a "if (!do_print)" ? The obvious answer is "try it", but then isdnd dies with segmentation fault when rc_config calls yyparse. I can't find this function. Leif To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isdn" in the body of the message