shithub: riscv

Download patch

ref: 3e0cad96acbf8a0c8bba46279df508b5ee5e5c8f
parent: 825f4af55f9ea7d0740b0987772945b8be2e1480
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Fri Jan 6 13:34:58 EST 2012

abaco: dont abort if theres no contenttype

--- a/sys/src/cmd/abaco/urls.c
+++ b/sys/src/cmd/abaco/urls.c
@@ -59,16 +59,15 @@
 	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};
 }
--