diff -up scim-bridge-0.4.5/agent/scim-bridge-agent.cpp.segfault-412511 scim-bridge-0.4.5/agent/scim-bridge-agent.cpp --- scim-bridge-0.4.5/agent/scim-bridge-agent.cpp.segfault-412511 2008-01-09 18:33:43.000000000 +0800 +++ scim-bridge-0.4.5/agent/scim-bridge-agent.cpp 2008-01-09 18:36:00.000000000 +0800 @@ -301,7 +301,7 @@ retval_t ScimBridgeAgentImpl::run_event_ scim_bridge_agent_event_type_t events = SCIM_BRIDGE_AGENT_EVENT_NONE; - if (FD_ISSET (socket_fd, &read_set) && (triggers & SCIM_BRIDGE_AGENT_EVENT_READ)) { + if (socket_fd >= 0 && FD_ISSET (socket_fd, &read_set) && (triggers & SCIM_BRIDGE_AGENT_EVENT_READ)) { if (events == SCIM_BRIDGE_AGENT_EVENT_NONE) { scim_bridge_pdebug (2, "Invoked triggers: READ"); } else { @@ -309,7 +309,7 @@ retval_t ScimBridgeAgentImpl::run_event_ } events |= SCIM_BRIDGE_AGENT_EVENT_READ; } - if (FD_ISSET (socket_fd, &write_set) && (triggers & SCIM_BRIDGE_AGENT_EVENT_WRITE)) { + if (socket_fd >= 0 && FD_ISSET (socket_fd, &write_set) && (triggers & SCIM_BRIDGE_AGENT_EVENT_WRITE)) { if (events == SCIM_BRIDGE_AGENT_EVENT_NONE) { scim_bridge_pdebug (2, "Invoked triggers: WRITE"); } else { @@ -317,7 +317,7 @@ retval_t ScimBridgeAgentImpl::run_event_ } events |= SCIM_BRIDGE_AGENT_EVENT_WRITE; } - if (FD_ISSET (socket_fd, &error_set) && (triggers & SCIM_BRIDGE_AGENT_EVENT_ERROR)) { + if (socket_fd >= 0 && FD_ISSET (socket_fd, &error_set) && (triggers & SCIM_BRIDGE_AGENT_EVENT_ERROR)) { if (events == SCIM_BRIDGE_AGENT_EVENT_NONE) { scim_bridge_pdebug (2, "Invoked triggers: ERROR"); } else {