2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright (c) 1989, 2011, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
2N/A/* All Rights Reserved */
2N/A
2N/A#include "mt.h"
2N/A#include "uucp.h"
2N/A
2N/Astatic void alarmtr(int);
2N/Astatic jmp_buf Sjbuf;
2N/Astatic char *fdig(char *);
2N/A#ifndef SMALL
2N/Astatic char *strecpy(char *, char *, char *);
2N/A#endif
2N/Astatic int interface(const char *);
2N/Astatic int fd_mklock(int);
2N/Astatic int getdialline(char *, int);
2N/Astatic int chat(int, char *[], int, char *, char *);
2N/Astatic void fixline(), fd_rmlock();
2N/Astatic void translate(char *, char *);
2N/Astatic int gdial(char *, char *[], int);
2N/Astatic int Modemctrl;
2N/Astatic unsigned connecttime;
2N/Astatic int (*Setup)();
2N/A
2N/A/*
2N/A * to add a new caller:
2N/A * declare the function that knows how to call on the device,
2N/A * add a line to the callers table giving the name of the device
2N/A * (from Devices file) and the name of the function
2N/A * add the function to the end of this file
2N/A */
2N/A
2N/A#ifdef TLI
2N/Astatic int tlicall(char *[], char *[]);
2N/A#endif /* TLI */
2N/A
2N/Astatic struct caller Caller[] = {
2N/A
2N/A#ifdef TLI
2N/A {"TLI", tlicall}, /* AT&T Transport Layer Interface */
2N/A#ifdef TLIS
2N/A {"TLIS", tlicall}, /* AT&T Transport Layer Interface */
2N/A#endif /* TLIS */
2N/A#endif /* TLI */
2N/A
2N/A {NULL, NULL} /* this line must be last */
2N/A};
2N/A
2N/A/*
2N/A * exphone - expand phone number for given prefix and number
2N/A *
2N/A * return code - none
2N/A */
2N/A
2N/Astatic void
2N/Aexphone(char *in, char *out)
2N/A{
2N/A FILE *fn;
2N/A char pre[MAXPH], npart[MAXPH], tpre[MAXPH], p[MAXPH];
2N/A char buf[BUFSIZ];
2N/A char *s1;
2N/A
2N/A if (!isalpha(*in)) {
2N/A (void) strcpy(out, in);
2N/A return;
2N/A }
2N/A
2N/A s1 = pre;
2N/A while (isalpha(*in))
2N/A *s1++ = *in++;
2N/A *s1 = NULLCHAR;
2N/A s1 = npart;
2N/A while (*in != NULLCHAR)
2N/A *s1++ = *in++;
2N/A *s1 = NULLCHAR;
2N/A
2N/A tpre[0] = NULLCHAR;
2N/A fn = fopen(DIALCODES, "rF");
2N/A if (fn != NULL) {
2N/A while (fgets(buf, BUFSIZ, fn)) {
2N/A if (sscanf(buf, "%60s%60s", p, tpre) < 1)
2N/A continue;
2N/A if (EQUALS(p, pre))
2N/A break;
2N/A tpre[0] = NULLCHAR;
2N/A }
2N/A (void) fclose(fn);
2N/A }
2N/A
2N/A (void) strcpy(out, tpre);
2N/A (void) strcat(out, npart);
2N/A}
2N/A
2N/A/*
2N/A * repphone - Replace \D and \T sequences in arg with phone
2N/A * expanding and translating as appropriate.
2N/A */
2N/Astatic char *
2N/Arepphone(char *arg, char *phone, char *trstr)
2N/A{
2N/A static char *pbuf; /* dynamically allocated below */
2N/A char *fp, *tp;
2N/A
2N/A if (pbuf == NULL) {
2N/A pbuf = malloc(2*(MAXPH+2));
2N/A if (pbuf == NULL)
2N/A return (arg);
2N/A }
2N/A for (tp = pbuf; *arg; arg++) {
2N/A if (*arg != '\\') {
2N/A *tp++ = *arg;
2N/A continue;
2N/A } else {
2N/A switch (*(arg+1)) {
2N/A case 'T':
2N/A exphone(phone, tp);
2N/A translate(trstr, tp);
2N/A for (; *tp; tp++)
2N/A ;
2N/A arg++;
2N/A break;
2N/A case 'D':
2N/A for (fp = phone; *tp = *fp++; tp++)
2N/A ;
2N/A arg++;
2N/A break;
2N/A default:
2N/A *tp++ = *arg;
2N/A break;
2N/A }
2N/A }
2N/A }
2N/A *tp = '\0';
2N/A return (pbuf);
2N/A}
2N/A
2N/Astatic uint_t saved_mode;
2N/Astatic char saved_dcname[20];
2N/A
2N/Astatic int pop_push(int);
2N/Astatic void setdevcfg(char *, char *);
2N/Astatic void ttygenbrk(int);
2N/A/*
2N/A * processdev - Process a line from the Devices file
2N/A *
2N/A * return codes:
2N/A * file descriptor - succeeded
2N/A * FAIL - failed
2N/A */
2N/Astatic int
2N/Aprocessdev(char *flds[], char *dev[])
2N/A{
2N/A int dcf = -1;
2N/A struct caller *ca;
2N/A char *args[D_MAX+1], dcname[20];
2N/A char **sdev;
2N/A int nullfd;
2N/A char *phonecl; /* clear phone string */
2N/A char phoneex[2*(MAXPH+2)]; /* expanded phone string */
2N/A struct termio tty_orig;
2N/A int ret_orig = -1;
2N/A
2N/A sdev = dev;
2N/A /* set up default "break" routine */
2N/A genbrk = ttygenbrk;
2N/A
2N/A /* initialize Devconfig info */
2N/A DEBUG(5, "processdev: calling setdevcfg(%s, ", Progname);
2N/A DEBUG(5, "%s)\n", flds[F_TYPE]);
2N/A setdevcfg(Progname, flds[F_TYPE]);
2N/A
2N/A for (ca = Caller; ca->CA_type != NULL; ca++) {
2N/A /* This will find built-in caller functions */
2N/A if (EQUALS(ca->CA_type, dev[D_CALLER])) {
2N/A DEBUG(5, "Internal caller type %s\n", dev[D_CALLER]);
2N/A if (dev[D_ARG] == NULL) {
2N/A /* if NULL - assume translate */
2N/A /* needed for for loop later to mark the end */
2N/A dev[D_ARG+1] = NULL;
2N/A dev[D_ARG] = "\\T";
2N/A }
2N/A dev[D_ARG] = repphone(dev[D_ARG], flds[F_PHONE], "");
2N/A if ((dcf = (*(ca->CA_caller))(flds, dev)) < 0)
2N/A return (dcf);
2N/A if (interface(ca->CA_type)) {
2N/A DEBUG(5, "interface(%s) failed", ca->CA_type);
2N/A Uerror = SS_DEVICE_FAILED;
2N/A /* restore vanilla unix interface */
2N/A (void) interface("UNIX");
2N/A return (FAIL);
2N/A }
2N/A dev += 2; /* Skip to next CALLER and ARG */
2N/A break;
2N/A }
2N/A }
2N/A if (dcf == -1) {
2N/A /* Here if not a built-in caller function */
2N/A
2N/A /* We do locking (file and advisory) after open */
2N/A
2N/A /*
2N/A * Open the line
2N/A */
2N/A if (*dev[D_LINE] != '/') {
2N/A (void) snprintf(dcname, sizeof (dcname),
2N/A "/dev/%s", dev[D_LINE]);
2N/A } else {
2N/A (void) strcpy(dcname, dev[D_LINE]);
2N/A }
2N/A /* take care of the possible partial open fd */
2N/A (void) close(nullfd = open("/", O_RDONLY));
2N/A if (setjmp(Sjbuf)) {
2N/A (void) close(nullfd);
2N/A DEBUG(1, "generic open timeout\n%s", "");
2N/A logent("generic open", "TIMEOUT");
2N/A Uerror = SS_CANT_ACCESS_DEVICE;
2N/A goto bad;
2N/A }
2N/A (void) signal(SIGALRM, alarmtr);
2N/A (void) alarm(10);
2N/A if (Modemctrl) {
2N/A DEBUG(7, "opening with O_NDELAY set\n%s", "");
2N/A dcf = open(dcname, (O_RDWR | O_NDELAY));
2N/A saved_mode = O_RDWR | O_NDELAY;
2N/A } else {
2N/A dcf = open(dcname, O_RDWR);
2N/A saved_mode = O_RDWR;
2N/A }
2N/A (void) strcpy(saved_dcname, dcname);
2N/A (void) alarm(0);
2N/A if (dcf < 0) {
2N/A DEBUG(1, "generic open failed, errno = %d\n", errno);
2N/A (void) close(nullfd);
2N/A logent("generic open", "FAILED");
2N/A Uerror = SS_CANT_ACCESS_DEVICE;
2N/A goto bad;
2N/A }
2N/A
2N/A /* check locks BEFORE modifying the stream */
2N/A
2N/A if (fd_mklock(dcf) != SUCCESS) {
2N/A DEBUG(1, "failed to lock device %s\n", dcname);
2N/A Uerror = SS_LOCKED_DEVICE;
2N/A goto bad;
2N/A }
2N/A
2N/A if (Modemctrl) {
2N/A DEBUG(7, "clear O_NDELAY\n%s", "");
2N/A if (fcntl(dcf, F_SETFL,
2N/A (fcntl(dcf, F_GETFL, 0) & ~O_NDELAY)) < 0) {
2N/A DEBUG(7, "clear O_NDELAY failed, errno %d\n",
2N/A errno);
2N/A Uerror = SS_DEVICE_FAILED;
2N/A goto bad;
2N/A }
2N/A }
2N/A }
2N/A
2N/A if ((*Setup)(MASTER, &dcf, &dcf)) {
2N/A /* any device|system lock files we should remove? */
2N/A DEBUG(5, "MASTER Setup failed%s", "");
2N/A Uerror = SS_DEVICE_FAILED;
2N/A goto bad;
2N/A }
2N/A
2N/A /* configure any requested streams modules */
2N/A if (!pop_push(dcf)) {
2N/A DEBUG(5, "STREAMS module configuration failed%s\n", "");
2N/A Uerror = SS_DEVICE_FAILED;
2N/A goto bad;
2N/A }
2N/A
2N/A /* save initial state of line in case script fails */
2N/A ret_orig = ioctl(dcf, TCGETA, &tty_orig);
2N/A
2N/A /* use sdev[] since dev[] is incremented for internal callers */
2N/A fixline(dcf, atoi(fdig(sdev[D_CLASS])), D_DIRECT);
2N/A
2N/A /*
2N/A * Now loop through the remaining callers and chat
2N/A * according to scripts in dialers file.
2N/A */
2N/A for (; dev[D_CALLER] != NULL; dev += 2) {
2N/A int w;
2N/A /*
2N/A * Scan Dialers file to find an entry
2N/A */
2N/A if ((w = gdial(dev[D_CALLER], args, D_MAX)) < 1) {
2N/A logent("generic call to gdial", "FAILED");
2N/A Uerror = SS_CANT_ACCESS_DEVICE;
2N/A goto bad;
2N/A }
2N/A if (w <= 2) /* do nothing - no chat */
2N/A break;
2N/A /*
2N/A * Translate the phone number
2N/A */
2N/A if (dev[D_ARG] == NULL) {
2N/A /* if NULL - assume no translation */
2N/A /* needed for for loop to mark the end */
2N/A dev[D_ARG+1] = NULL;
2N/A dev[D_ARG] = "\\D";
2N/A }
2N/A
2N/A phonecl = repphone(dev[D_ARG], flds[F_PHONE], args[1]);
2N/A exphone(phonecl, phoneex);
2N/A translate(args[1], phoneex);
2N/A /*
2N/A * Chat
2N/A */
2N/A if (chat(w-2, &args[2], dcf, phonecl, phoneex) != SUCCESS) {
2N/A CDEBUG(5, "\nCHAT gdial(%s) FAILED\n", dev[D_CALLER]);
2N/A Uerror = SS_CHAT_FAILED;
2N/A goto bad;
2N/A }
2N/A }
2N/A /*
2N/A * Success at last!
2N/A */
2N/A (void) strcpy(Dc, sdev[D_LINE]);
2N/A return (dcf);
2N/Abad:
2N/A if (dcf >= 0) {
2N/A /* reset line settings if we got them in the beginning */
2N/A if (ret_orig == 0)
2N/A (void) ioctl(dcf, TCSETAW, &tty_orig);
2N/A fd_rmlock(dcf);
2N/A (void) close(dcf);
2N/A }
2N/A /* restore vanilla unix interface */
2N/A (void) interface("UNIX");
2N/A return (FAIL);
2N/A}
2N/A
2N/A/*
2N/A * clear_hup() clear the hangup state of the given device
2N/A */
2N/Astatic int
2N/Aclear_hup(int dcf)
2N/A{
2N/A int ndcf;
2N/A if ((ndcf = open(saved_dcname, saved_mode)) < 0) {
2N/A return (FAIL);
2N/A }
2N/A if (ndcf != dcf) {
2N/A (void) close(ndcf);
2N/A }
2N/A return (SUCCESS);
2N/A}
2N/A
2N/A
2N/A/*
2N/A * translate the pairs of characters present in the first
2N/A * string whenever the first of the pair appears in the second
2N/A * string.
2N/A */
2N/Astatic void
2N/Atranslate(char *ttab, char *str)
2N/A{
2N/A char *s;
2N/A
2N/A for (; *ttab && *(ttab+1); ttab += 2)
2N/A for (s = str; *s; s++)
2N/A if (*ttab == *s)
2N/A *s = *(ttab+1);
2N/A}
2N/A
2N/A#define MAXLINE 512
2N/A
2N/Astatic void dialreset(void);
2N/A#ifndef SMALL
2N/Astatic char *currdial(void);
2N/A#endif
2N/A/*
2N/A * Get the information about the dialer.
2N/A * gdial(type, arps, narps)
2N/A * type -> type of dialer (e.g., penril)
2N/A * arps -> array of pointers returned by gdial
2N/A * narps -> number of elements in array returned by gdial
2N/A * Return value:
2N/A * -1 -> Can't open DIALERFILE
2N/A * 0 -> requested type not found
2N/A * >0 -> success - number of fields filled in
2N/A */
2N/Astatic int
2N/Agdial(char *type, char *arps[], int narps)
2N/A{
2N/A static char *info; /* dynamically allocated MAXLINE */
2N/A int na;
2N/A
2N/A DEBUG(2, "gdial(%s) called\n", type);
2N/A if (info == NULL) {
2N/A info = malloc(MAXLINE);
2N/A if (info == NULL) {
2N/A DEBUG(1, "malloc failed for info in gdial\n", 0);
2N/A return (0);
2N/A }
2N/A }
2N/A while (getdialline(info, MAXLINE)) {
2N/A if ((info[0] == '#') || (info[0] == ' ') ||
2N/A (info[0] == '\t') || (info[0] == '\n'))
2N/A continue;
2N/A if ((na = getargs(info, arps, narps)) == 0)
2N/A continue;
2N/A if (EQUALS(arps[0], type)) {
2N/A DEBUG(5, "Trying caller script '%s'", type);
2N/A DEBUG(5, " from '%s'.\n", currdial());
2N/A dialreset();
2N/A bsfix(arps);
2N/A return (na);
2N/A }
2N/A }
2N/A DEBUG(1, "%s not found in Dialers file\n", type);
2N/A dialreset();
2N/A return (0);
2N/A}
2N/A
2N/A#ifdef TLI
2N/A/*
2N/A *
2N/A * AT&T Transport Layer Interface
2N/A *
2N/A * expected in Devices
2N/A * TLI line1 - - TLI
2N/A * or
2N/A * TLIS line1 - - TLIS
2N/A *
2N/A */
2N/A
2N/A#include <tiuser.h>
2N/A
2N/Astatic void tfaillog(int fd, const char *s);
2N/A
2N/A#define CONNECT_ATTEMPTS 3
2N/A#define TFREE(p, type) if ((p)) (void) t_free((char *)(p), (type))
2N/A
2N/Astatic struct netbuf *stoa(char *, struct netbuf *);
2N/A/*
2N/A * returns fd to remote uucp daemon
2N/A */
2N/A/*ARGSUSED*/
2N/Astatic int
2N/Atlicall(char *flds[], char *dev[])
2N/A{
2N/A char addrbuf[ BUFSIZ ];
2N/A char devname[MAXNAMESIZE];
2N/A int fd;
2N/A int i, j;
2N/A struct t_bind *bind_ret = 0;
2N/A struct t_info tinfo;
2N/A struct t_call *sndcall = 0, *rcvcall = 0;
2N/A
2N/A
2N/A if (dev[D_LINE][0] != '/') {
2N/A /* dev holds device name relative to /dev */
2N/A (void) snprintf(devname, sizeof (devname),
2N/A "/dev/%s", dev[D_LINE]);
2N/A } else {
2N/A /* dev holds full path name of device */
2N/A (void) strcpy(devname, dev[D_LINE]);
2N/A }
2N/A /* gimme local transport endpoint */
2N/A errno = t_errno = 0;
2N/A if (setjmp(Sjbuf)) {
2N/A DEBUG(1, "t_open timeout\n%s", "");
2N/A logent("t_open", "TIMEOUT");
2N/A Uerror = SS_NO_DEVICE;
2N/A return (FAIL);
2N/A }
2N/A (void) signal(SIGALRM, alarmtr);
2N/A (void) alarm(5);
2N/A fd = t_open(devname, O_RDWR, &tinfo);
2N/A (void) alarm(0);
2N/A if (fd < 0) {
2N/A tfaillog(fd, "t_open");
2N/A Uerror = SS_NO_DEVICE;
2N/A return (FAIL);
2N/A }
2N/A if (fd_mklock(fd) != SUCCESS) {
2N/A (void) t_close(fd);
2N/A DEBUG(1, "tlicall: failed to lock device %s\n", devname);
2N/A Uerror = SS_LOCKED_DEVICE;
2N/A return (FAIL);
2N/A }
2N/A
2N/A /* allocate tli structures */
2N/A errno = t_errno = 0;
2N/A if ((bind_ret = (struct t_bind *)t_alloc(fd, T_BIND, T_ALL)) == NULL ||
2N/A (sndcall = (struct t_call *)t_alloc(fd, T_CALL, T_ALL)) == NULL ||
2N/A (rcvcall = (struct t_call *)t_alloc(fd, T_CALL, T_ALL)) == NULL) {
2N/A tfaillog(fd, "t_alloc");
2N/A TFREE(bind_ret, T_BIND);
2N/A TFREE(sndcall, T_CALL);
2N/A TFREE(rcvcall, T_CALL);
2N/A Uerror = SS_NO_DEVICE;
2N/A return (FAIL);
2N/A }
2N/A
2N/A /* bind */
2N/A errno = t_errno = 0;
2N/A if (t_bind(fd, (struct t_bind *)0, bind_ret) < 0) {
2N/A tfaillog(fd, "t_bind");
2N/A TFREE(bind_ret, T_BIND);
2N/A TFREE(sndcall, T_CALL);
2N/A TFREE(rcvcall, T_CALL);
2N/A Uerror = SS_NO_DEVICE;
2N/A fd_rmlock(fd);
2N/A (void) t_close(fd);
2N/A return (FAIL);
2N/A }
2N/A DEBUG(5, "tlicall: bound to %s\n", bind_ret->addr.buf);
2N/A
2N/A /*
2N/A * Prepare to connect.
2N/A *
2N/A * If address begins with "\x", "\X", "\o", or "\O",
2N/A * assume is hexadecimal or octal address and use stoa()
2N/A * to convert it.
2N/A *
2N/A * Else is usual uucico address -- only \N's left to process.
2N/A * Walk thru connection address, changing \N's to NULLCHARs.
2N/A * Note: If a NULLCHAR must be part of the connection address,
2N/A * it must be overtly included in the address. One recommended
2N/A * way is to do it in the Devices file, thusly:
2N/A * Netname /dev/netport - - TLI \D\000
2N/A * bsfix() turns \000 into \N and then the loop below makes it a
2N/A * real, included-in-the-length null-byte.
2N/A *
2N/A * The DEBUG must print the strecpy'd address (so that
2N/A * non-printables will have been replaced with C escapes).
2N/A */
2N/A
2N/A DEBUG(5, "t_connect to addr \"%s\"\n",
2N/A strecpy(addrbuf, dev[D_ARG], "\\"));
2N/A
2N/A if (dev[D_ARG][0] == '\\' && (dev[D_ARG][1] == 'x' ||
2N/A dev[D_ARG][1] == 'X' || dev[D_ARG][1] == 'o' ||
2N/A dev[D_ARG][1] == 'O')) {
2N/A if (stoa(dev[D_ARG], &(sndcall->addr)) == NULL) {
2N/A DEBUG(5, "tlicall: stoa failed\n%s", "");
2N/A logent("tlicall", "string-to-address failed");
2N/A TFREE(bind_ret, T_BIND);
2N/A TFREE(sndcall, T_CALL);
2N/A TFREE(rcvcall, T_CALL);
2N/A Uerror = SS_NO_DEVICE;
2N/A fd_rmlock(fd);
2N/A (void) t_close(fd);
2N/A return (FAIL);
2N/A }
2N/A } else {
2N/A for (i = j = 0; i < BUFSIZ && dev[D_ARG][i] != NULLCHAR;
2N/A ++i, ++j) {
2N/A if (dev[D_ARG][i] == '\\' && dev[D_ARG][i+1] == 'N') {
2N/A addrbuf[j] = NULLCHAR;
2N/A ++i;
2N/A } else {
2N/A addrbuf[j] = dev[D_ARG][i];
2N/A }
2N/A }
2N/A sndcall->addr.buf = addrbuf;
2N/A sndcall->addr.len = j;
2N/A }
2N/A
2N/A if (setjmp(Sjbuf)) {
2N/A DEBUG(4, "timeout tlicall\n%s", "");
2N/A logent("tlicall", "TIMEOUT");
2N/A TFREE(bind_ret, T_BIND);
2N/A TFREE(sndcall, T_CALL);
2N/A TFREE(rcvcall, T_CALL);
2N/A Uerror = SS_NO_DEVICE;
2N/A fd_rmlock(fd);
2N/A (void) t_close(fd);
2N/A return (FAIL);
2N/A }
2N/A (void) signal(SIGALRM, alarmtr);
2N/A (void) alarm(connecttime);
2N/A
2N/A /* connect to the service -- some listeners can't handle */
2N/A /* multiple connect requests, so try it a few times */
2N/A errno = t_errno = 0;
2N/A for (i = 0; i < CONNECT_ATTEMPTS; ++i) {
2N/A if (t_connect(fd, sndcall, rcvcall) == 0)
2N/A break;
2N/A if ((t_errno == TLOOK) && (t_look(fd) == T_DISCONNECT)) {
2N/A (void) t_rcvdis(fd, NULL);
2N/A (void) alarm(0);
2N/A } else {
2N/A (void) alarm(0);
2N/A tfaillog(fd, "t_connect");
2N/A TFREE(bind_ret, T_BIND);
2N/A TFREE(sndcall, T_CALL);
2N/A TFREE(rcvcall, T_CALL);
2N/A Uerror = SS_DIAL_FAILED;
2N/A fd_rmlock(fd);
2N/A (void) t_close(fd);
2N/A return (FAIL);
2N/A }
2N/A }
2N/A (void) alarm(0);
2N/A TFREE(bind_ret, T_BIND);
2N/A TFREE(sndcall, T_CALL);
2N/A TFREE(rcvcall, T_CALL);
2N/A if (i == CONNECT_ATTEMPTS) {
2N/A tfaillog(fd, "t_connect");
2N/A Uerror = SS_DIAL_FAILED;
2N/A fd_rmlock(fd);
2N/A (void) t_close(fd);
2N/A return (FAIL);
2N/A }
2N/A errno = t_errno = 0;
2N/A (void) strcpy(Dc, dev[D_CALLER]);
2N/A return (fd);
2N/A}
2N/A#endif /* TLI */