shithub: mq

Download patch

ref: 2d7d9916d34ceeaef920d1f1e00aed6d215d7ca1
parent: cde78938f73fa85df040c8078c77d1bffc0c2132
author: kvik <kvik@a-b.xyz>
date: Sat Sep 12 17:07:33 EDT 2020

mq-cat: check for read(2) error

--- a/src/mq-cat.c
+++ b/src/mq-cat.c
@@ -60,6 +60,8 @@
 	for(;;){
 		if((n = read(orderfd, name, sizeof(name)-1)) == 0)
 			break;
+		if(n == -1)
+			sysfatal("read: %r");
 		name[n] = 0;
 		for(i = 0, s = streams; i < ns; i++, s++){
 			if(strcmp(s->name, name) != 0 || s->fd == -1)