X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=blobdiff_plain;f=src%2Fpsendfile.c;fp=src%2Fpsendfile.c;h=3e26f8f0033fff6caf0c99af58e4ac06eac57d93;hp=08cd1d212ea239fa72fda5a777f81b8a21fc5d53;hb=bcad6b0c48d516ddc920b52f06083ceaa242e1ca;hpb=589987f8218c9aa61d65f582a3b3e1bbd32bda81 diff --git a/src/psendfile.c b/src/psendfile.c index 08cd1d2..3e26f8f 100644 --- a/src/psendfile.c +++ b/src/psendfile.c @@ -227,7 +227,7 @@ static void serve(struct muth *muth, va_list args) sfile = NULL; contype = NULL; - out = mtstdopen(fd, 1, 60, "r+"); + out = mtstdopen(fd, 1, 60, "r+", NULL); if((file = getheader(req, "X-Ash-File")) == NULL) { flog(LOG_ERR, "psendfile: needs to be called with the X-Ash-File header"); @@ -238,7 +238,7 @@ static void serve(struct muth *muth, va_list args) simpleerror2(out, 404, "Not Found", "The requested URL has no corresponding resource."); goto out; } - if(((sfile = fopen(file, "r")) < 0) || fstat(fileno(sfile), &sb)) { + if(((sfile = fopen(file, "r")) == NULL) || fstat(fileno(sfile), &sb)) { flog(LOG_ERR, "psendfile: could not stat input file %s: %s", file, strerror(errno)); simpleerror2(out, 500, "Internal Error", "The server could not access its own data."); goto out;