commit b55de916338eef77a509a3d698d0f3d98f079804 from: Omar Polo date: Sat Oct 03 10:43:34 2020 UTC remame sendfile to send_file and senddir to send_dir apparently, on some systems there is a sendfile(2), so to avoid a name clash we rename it to send_file and send_dir. commit - 0d8ca45a28a97215c20fdc13c13f764cb571ad7c commit + b55de916338eef77a509a3d698d0f3d98f079804 blob - 394dd9a50a3f2b4696417147fea60e967ba0105c blob + e56cb0a43a67a8af6f59bab8dd7daa7c5bfbc6ec --- gmid.c +++ gmid.c @@ -169,10 +169,10 @@ isdir(int fd) return S_ISDIR(sb.st_mode); } -void senddir(char*, struct tls*); +void send_dir(char*, struct tls*); void -sendfile(char *path, struct tls *ctx) +send_file(char *path, struct tls *ctx) { int fd; char fpath[PATHBUF]; @@ -196,7 +196,7 @@ sendfile(char *path, struct tls *ctx) if (isdir(fd)) { warnx("%s is a directory, trying %s/index.gmi", fpath, fpath); close(fd); - senddir(fpath, ctx); + send_dir(fpath, ctx); return; } @@ -232,7 +232,7 @@ exit: } void -senddir(char *path, struct tls *ctx) +send_dir(char *path, struct tls *ctx) { char fpath[PATHBUF]; size_t len; @@ -253,7 +253,7 @@ senddir(char *path, struct tls *ctx) strlcat(fpath, "index.gmi", sizeof(fpath)); - sendfile(fpath, ctx); + send_file(fpath, ctx); } void @@ -274,9 +274,9 @@ handle(char *url, struct tls *ctx) fprintf(stderr, "requested path: %s\n", path); if (path_isdir(path)) - senddir(path, ctx); + send_dir(path, ctx); else - sendfile(path, ctx); + send_file(path, ctx); } int