/* * Copyright (C) 1997-2000 SpellCaster Telecommunications Inc. * $Id: hangup.c,v 1.1 2004/03/11 03:59:32 bcrl Exp $ * Released under the GNU Public License. See LICENSE file for details. */ #include #include #include #include #include #include #include #include #include #include "../include/aps_if.h" int open_dev(const char *name) { int fd = open(name, O_RDWR | O_NONBLOCK); if (-1 == fd && ENOENT == errno) { char buf[256]; strcpy(buf, "/dev/"); strncpy(buf, name, 255); buf[255] = 0; fd = open(name, O_RDWR | O_NONBLOCK); } if (-1 == fd) fprintf(stderr, "Error opening %s: %s\n", name, strerror(errno)); return fd; } int main ( int argc, char *argv[] ) { int fd, i; if (argc < 2) { fprintf(stderr, "Usage: %s \n -- Sends a hangup ioctl to the specified device.\n", argv[0]); return 2; } for (i=1; i