diff options
author | Leah Neukirchen <leah@vuxu.org> | 2020-05-09 21:47:41 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2020-05-09 21:47:41 +0200 |
commit | d1ebc6ac96b95d982fb1c85044137e57a59861d9 (patch) | |
tree | d7032d059f59d0aaf8f660cd4141a37ee3b631f1 | |
parent | c30d9da34a0f9afd72e9afd3cdfd2c288a0cfb4d (diff) | |
download | hittpd-d1ebc6ac96b95d982fb1c85044137e57a59861d9.tar.gz hittpd-d1ebc6ac96b95d982fb1c85044137e57a59861d9.tar.xz hittpd-d1ebc6ac96b95d982fb1c85044137e57a59861d9.zip |
good morning
-rw-r--r-- | hittpd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hittpd.c b/hittpd.c index 5e43a8c..231da84 100644 --- a/hittpd.c +++ b/hittpd.c @@ -908,12 +908,12 @@ main(int argc, char *argv[]) addr.sun_family = AF_UNIX; strncpy(addr.sun_path, uds, sizeof(addr.sun_path)-1); listenfd = socket(AF_UNIX, SOCK_STREAM, 0); - if (r < 0) { + if (listenfd < 0) { perror("socket"); exit(111); } unlink(uds); - bind(listenfd, (struct sockaddr*)&addr, sizeof addr); + r = bind(listenfd, (struct sockaddr*)&addr, sizeof addr); if (r < 0) { perror("bind"); exit(111); @@ -937,7 +937,7 @@ main(int argc, char *argv[]) } listenfd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); - if (r < 0) { + if (listenfd < 0) { perror("socket"); exit(111); } |