|| old_state == m_new_datagram_socket
|| old_state == m_new_unknown_socket
|| old_state == m_start
- || old_state == m_stop))
+ || old_state == m_stop
+ || old_state == m_constant_fd))
{
/* Complain about "bind" or "connect" in wrong phase. */
tree diag_arg = sm_ctxt->get_diagnostic_tree (fd_sval);
if (!check_for_socket_fd (cd, successful, sm_ctxt, fd_sval, node, old_state))
return false;
if (!(old_state == m_start
+ || old_state == m_constant_fd
|| old_state == m_stop
|| old_state == m_bound_stream_socket
|| old_state == m_bound_unknown_socket
if (!check_for_socket_fd (cd, successful, sm_ctxt, fd_sval, node, old_state))
return false;
- if (old_state == m_start)
- /* If we were in the start state, assume we had the expected state. */
+ if (old_state == m_start || old_state == m_constant_fd)
+ /* If we were in the start state (or a constant), assume we had the
+ expected state. */
sm_ctxt->set_next_state (cd.get_call_stmt (), fd_sval,
m_listening_stream_socket);
else if (old_state == m_stop)
close (fd);
}
-void test_listed_on_connected_socket (int fd)
+void test_listen_on_connected_socket (int fd)
{
int afd = accept (fd, NULL, 0);
if (afd == -1)
/* { dg-message "'listen' expects a bound stream socket file descriptor but 'afd' is connected" "final event" { target *-*-* } .-1 } */
close (afd);
}
+
+int test_listen_on_constant ()
+{
+ return listen (0, 10);
+}