diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -26,9 +26,12 @@ int main() { perror("could not listen"); return 1; } - printf("hello world\n"); - - int ac = accept(sfd, (struct sockaddr *)&addr, NULL); - printf("client connected"); + int ac = accept(sfd, NULL, NULL); + if (ac == -1) { + perror("could not accept"); + return 1; + } + const char *buf = "Hello from telnet!\n"; + write(ac, buf, strlen(buf)); return 0; } |
