summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index ee8710d..71cea19 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;
}