1*48651Sbostic /*- 2*48651Sbostic * Copyright (c) 1985 The Regents of the University of California. 3*48651Sbostic * All rights reserved. 4*48651Sbostic * 5*48651Sbostic * %sccs.include.proprietary.c% 6*48651Sbostic */ 7*48651Sbostic 817772Sralph #ifndef lint 9*48651Sbostic static char sccsid[] = "@(#)dk.c 4.4 (Berkeley) 04/24/91"; 10*48651Sbostic #endif /* not lint */ 1117772Sralph 1246875Sbostic #include "condevs.h" 1317772Sralph #ifdef DATAKIT 1417772Sralph #include <dk.h> 1517772Sralph #define DKTRIES 2 1617772Sralph /*** 1717772Sralph * dkopn(flds) make datakit connection 1817772Sralph * 1917772Sralph * return codes: 2017772Sralph * >0 - file number - ok 2117772Sralph * FAIL - failed 2217772Sralph */ 2317772Sralph dkopn(flds) 2417772Sralph char *flds[]; 2517772Sralph { 2617772Sralph int dkphone; 2717772Sralph register char *cp; 2817772Sralph register ret, i; 2917772Sralph 3017772Sralph if (setjmp(Sjbuf)) 3117772Sralph return CF_DIAL; 3217772Sralph 3317772Sralph signal(SIGALRM, alarmtr); 3417772Sralph dkphone = 0; 3517772Sralph cp = flds[F_PHONE]; 3617772Sralph while(*cp) 3717772Sralph dkphone = 10 * dkphone + (*cp++ - '0'); 3817772Sralph DEBUG(4, "dkphone (%d) ", dkphone); 3917772Sralph for (i = 0; i < DKTRIES; i++) { 4017772Sralph getnextfd(); 4117772Sralph ret = dkdial(D_SH, dkphone, 0); 4217772Sralph next_fd = -1; 4317772Sralph DEBUG(4, "dkdial (%d)\n", ret); 4417772Sralph if (ret > -1) 4517772Sralph break; 4617772Sralph } 4717772Sralph return ret; 4817772Sralph } 4917772Sralph #endif 50