abaco: dont abort if theres no contenttype
This commit is contained in:
parent
825f4af55f
commit
3e0cad96ac
1 changed files with 7 additions and 8 deletions
|
@ -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};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue