We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0fccc85 commit 6437409Copy full SHA for 6437409
1 file changed
src/listendemo.c
@@ -131,11 +131,13 @@ int main (int argc, char *argv []) {
131
argv [0], strerror (errno));
132
exit (1);
133
}
134
- sox = accept (sox, NULL, 0);
135
- if (sox == -1) {
136
- fprintf (stderr, "%s: Failed to accept connection from socket: %s\n",
137
- argv [0], strerror (errno));
138
- exit (1);
+ if (cnxtp == SOCK_STREAM) {
+ sox = accept (sox, NULL, 0);
+ if (sox == -1) {
+ fprintf (stderr, "%s: Failed to accept connection from socket: %s\n",
+ argv [0], strerror (errno));
139
+ exit (1);
140
+ }
141
142
143
0 commit comments