aboutsummaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-12-16 13:53:35 +0800
committerGuangxiong Lin <[email protected]>2022-12-16 13:53:35 +0800
commit7369505397cdfddf0883e2c24e1652df8bd488fe (patch)
treee961bd1bba0276e2c5f523bf12663b34983c9e51 /util.c
parent49839c88a98d3798f7b18c58f54f26f36cacff38 (diff)
downloadtinyserver-7369505397cdfddf0883e2c24e1652df8bd488fe.tar.gz
tinyserver-7369505397cdfddf0883e2c24e1652df8bd488fe.tar.bz2
tinyserver-7369505397cdfddf0883e2c24e1652df8bd488fe.zip
Refactor file structure
Diffstat (limited to 'util.c')
-rw-r--r--util.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/util.c b/util.c
deleted file mode 100644
index b4053fd..0000000
--- a/util.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <stdlib.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-
-#include "util.h"
-#include "constant.h"
-
-void panic(const char *msg)
-{
- perror(msg);
- exit(EXIT_FAILURE);
-}
-
-int setblocking(int fd, bool blocking)
-{
- u_long mode = blocking ? 0 : 1;
- if (ioctl(fd, FIONBIO, &mode) == -1)
- return ERROR;
-
- return OK;
-}