mirror of
https://github.com/tsl0922/ttyd.git
synced 2026-01-10 12:54:22 +01:00
Add support for listening on UNIX domain socket
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
@@ -35,6 +36,13 @@ uppercase(char *str) {
|
||||
return str;
|
||||
}
|
||||
|
||||
bool
|
||||
endswith(const char * str, const char * suffix) {
|
||||
size_t str_len = strlen(str);
|
||||
size_t suffix_len = strlen(suffix);
|
||||
return str_len > suffix_len && !strcmp(str + (str_len - suffix_len), suffix);
|
||||
}
|
||||
|
||||
int
|
||||
get_sig_name(int sig, char *buf) {
|
||||
int n = sprintf(buf, "SIG%s", sig < NSIG ? strsignal(sig) : "unknown");
|
||||
|
||||
Reference in New Issue
Block a user