diff options
author | cinap_lenrek <cinap_lenrek@centraldogma> | 2012-01-06 18:34:58 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@centraldogma> | 2012-01-06 18:34:58 +0100 |
commit | 3e0cad96acbf8a0c8bba46279df508b5ee5e5c8f (patch) | |
tree | 868610973e845101c3b8f446ccf70c45b0760e82 | |
parent | 825f4af55f9ea7d0740b0987772945b8be2e1480 (diff) | |
download | plan9front-3e0cad96acbf8a0c8bba46279df508b5ee5e5c8f.tar.xz |
abaco: dont abort if theres no contenttype
-rw-r--r-- | sys/src/cmd/abaco/urls.c | 15 |
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}; } |