| 953 | ----------------------------------------------------------*/ |
| 954 | |
| 955 | static int port_opened(const char *filename) |
| 956 | { |
| 957 | struct termios_list *index = first_tl; |
| 958 | |
| 959 | ENTER("port_opened"); |
| 960 | |
| 961 | if (! index) |
| 962 | { |
| 963 | return 0; |
| 964 | } |
| 965 | |
| 966 | if (!strcmp(index->filename, filename)) |
| 967 | { |
| 968 | return index->fd; |
| 969 | } |
| 970 | |
| 971 | while (index->next) |
| 972 | { |
| 973 | index = index->next; |
| 974 | |
| 975 | if (!strcmp(index->filename, filename)) |
| 976 | { |
| 977 | return index->fd; |
| 978 | } |
| 979 | } |
| 980 | |
| 981 | LEAVE("port_opened"); |
| 982 | return 0; |
| 983 | } |
| 984 | |
| 985 | /*---------------------------------------------------------- |
| 986 | open_port() |