-/* $OpenBSD: ikeca.c,v 1.50 2021/01/23 21:51:29 tobhe Exp $ */
+/* $OpenBSD: ikeca.c,v 1.51 2021/01/23 22:04:55 tobhe Exp $ */
/*
* Copyright (c) 2010 Jonathan Gray <jsg@openbsd.org>
}
while ((r = read(ifd, buf, sizeof(buf))) > 0) {
- write(ofd, buf, r);
+ if (write(ofd, buf, r) == -1)
+ err(1, "%s: write", __func__);
}
close(ofd);
err(1, "%s: snprintf", __func__);
if ((fd = open(dst, O_WRONLY|O_CREAT, 0644)) == -1)
err(1, "open %s", dst);
- write(fd, myname, strlen(myname));
+ if (write(fd, myname, strlen(myname)) == -1)
+ err(1, "%s: write", __func__);
close(fd);
}