osmo-pcap-server: Just check for >= 0 to find a valid fd

This commit is contained in:
Holger Hans Peter Freyther 2011-06-01 16:33:11 +02:00
parent dc3d1dcd59
commit 54ff0b1b86
1 changed files with 2 additions and 2 deletions

View File

@ -38,13 +38,13 @@
static void close_connection(struct osmo_pcap_conn *conn)
{
if (conn->rem_fd.fd != -1) {
if (conn->rem_fd.fd >= 0) {
close(conn->rem_fd.fd);
conn->rem_fd.fd = -1;
osmo_fd_unregister(&conn->rem_fd);
}
if (conn->local_fd != -1) {
if (conn->local_fd >= 0) {
close(conn->local_fd);
conn->local_fd = -1;
}