abaco: dont abort if theres no contenttype

This commit is contained in:
cinap_lenrek 2012-01-06 18:34:58 +01:00
parent 825f4af55f
commit 3e0cad96ac

View file

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