+// SPDX-License-Identifier: BSD-2-Clause-Patent
+
/*
* Walk a list of input files, printing the name and buildid of any file
* that has one.
- *
- * This program is licensed under the GNU Public License version 2.
*/
#include <err.h>
char *b = NULL;
size_t sz;
uint8_t *data;
+ ssize_t written;
if (!strcmp(f, "-")) {
fd = STDIN_FILENO;
b = alloca(sz * 2 + 1);
data2hex(data, sz, b);
if (b) {
- write(1, f, strlen(f));
- write(1, " ", 1);
- write(1, b, strlen(b));
- write(1, "\n", 1);
+ written = write(1, f, strlen(f));
+ if (written < 0)
+ errx(1, "Error writing build id");
+ written = write(1, " ", 1);
+ written = write(1, b, strlen(b));
+ if (written < 0)
+ errx(1, "Error writing build id");
+ written = write(1, "\n", 1);
}
}
elf_end(elf);