aboutsummaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-12-01 16:08:38 +0800
committerGuangxiong Lin <[email protected]>2022-12-01 16:23:11 +0800
commit122a69f715acfe73963a2347cbb335e41bce944c (patch)
treec662e60fd13991c786de57110f9303edc0b2d39b /common.c
parent5626ba1525179d634676a347b5cd869cc3266090 (diff)
downloadtinyserver-122a69f715acfe73963a2347cbb335e41bce944c.tar.gz
tinyserver-122a69f715acfe73963a2347cbb335e41bce944c.tar.bz2
tinyserver-122a69f715acfe73963a2347cbb335e41bce944c.zip
Implement echo server with error handling
Implement echo server with error handling Fix gitignore Implement an echo server with error handling
Diffstat (limited to 'common.c')
-rw-r--r--common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/common.c b/common.c
new file mode 100644
index 0000000..154e60d
--- /dev/null
+++ b/common.c
@@ -0,0 +1,8 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+void panic(const char *msg)
+{
+ perror(msg);
+ exit(EXIT_FAILURE);
+}