summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@centraldogma>2012-01-06 18:34:58 +0100
committercinap_lenrek <cinap_lenrek@centraldogma>2012-01-06 18:34:58 +0100
commit3e0cad96acbf8a0c8bba46279df508b5ee5e5c8f (patch)
tree868610973e845101c3b8f446ccf70c45b0760e82
parent825f4af55f9ea7d0740b0987772945b8be2e1480 (diff)
downloadplan9front-3e0cad96acbf8a0c8bba46279df508b5ee5e5c8f.tar.xz
abaco: dont abort if theres no contenttype
-rw-r--r--sys/src/cmd/abaco/urls.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/src/cmd/abaco/urls.c b/sys/src/cmd/abaco/urls.c
index 9386cb164..7a58a81f0 100644
--- a/sys/src/cmd/abaco/urls.c
+++ b/sys/src/cmd/abaco/urls.c
@@ -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");
-
- n = read(fd, buf, sizeof(buf)-1);
- if(n < 0)
- error("can't read");
-
- close(fd);
+ if(fd >= 0){
+ n = read(fd, buf, sizeof(buf)-1);
+ if(n < 0)
+ n = 0;
+ close(fd);
+ }
buf[n] = '\0';
return (Runestr){runesmprint("%s", buf), n};
}