summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bltin/test.c3
-rw-r--r--src/mkinit.c9
2 files changed, 8 insertions, 4 deletions
diff --git a/src/bltin/test.c b/src/bltin/test.c
index 9b09094..f16c819 100644
--- a/src/bltin/test.c
+++ b/src/bltin/test.c
@@ -489,7 +489,8 @@ bash_group_member(gid_t gid)
 
 	ngroups = getgroups(0, NULL);
 	group_array = stalloc(ngroups * sizeof(gid_t));
-	getgroups(ngroups, group_array);
+	if ((getgroups(ngroups, group_array)) != ngroups)
+		return (0);
 
 	/* Search through the list looking for GID. */
 	for (i = 0; i < ngroups; i++)
diff --git a/src/mkinit.c b/src/mkinit.c
index e803751..9714bee 100644
--- a/src/mkinit.c
+++ b/src/mkinit.c
@@ -427,9 +427,12 @@ writetext(struct text *text, FILE *fp)
 	struct block *bp;
 
 	if (text->start != NULL) {
-		for (bp = text->start ; bp != text->last ; bp = bp->next)
-			fwrite(bp->text, sizeof (char), BLOCKSIZE, fp);
-		fwrite(bp->text, sizeof (char), BLOCKSIZE - text->nleft, fp);
+		for (bp = text->start ; bp != text->last ; bp = bp->next) {
+			if ((fwrite(bp->text, sizeof (char), BLOCKSIZE, fp)) != BLOCKSIZE)
+				error("Can't write data\n");
+		}
+		if ((fwrite(bp->text, sizeof (char), BLOCKSIZE - text->nleft, fp)) != (BLOCKSIZE - text->nleft))
+			error("Can't write data\n");
 	}
 }
 
mmit/posix.url?h=2063.8&id=809ff158273fc06b5d108a64bc55eeca2f96aa1f&follow=1'>Update to man-pages-posix 2017-aJune McEnroe 2020-12-14Update to OpenBSD 6.8June McEnroe 2020-12-14Update to NetBSD 9.1June McEnroe 2020-12-14Update to man-pages 5.09June McEnroe 2020-12-14Update to FreeBSD 12.2June McEnroe 2020-06-08Update to OpenBSD 6.7June McEnroe 2020-05-04Add hack for macOS to search extra man sectionsJune McEnroe 2020-05-04Don't clear MANSECTJune McEnroe