abaco: dont abort if theres no contenttype

front
cinap_lenrek 2012-01-06 18:34:58 +01:00
parent 825f4af55f
commit 3e0cad96ac
1 changed files with 7 additions and 8 deletions

View File

@ -59,16 +59,15 @@ getattr(int conn, char *s)
char buf[BUFSIZE];
int fd, n;
n = 0;
snprint(buf, sizeof(buf), "%s/%d/%s", webmountpt, conn, s);
fd = open(buf, OREAD);
if(fd < 0)
error("can't open attr file");
if(fd >= 0){
n = read(fd, buf, sizeof(buf)-1);
if(n < 0)
error("can't read");
n = 0;
close(fd);
}
buf[n] = '\0';
return (Runestr){runesmprint("%s", buf), n};
}