MCPcopy Create free account
hub / github.com/containers/bubblewrap / load_file_at

Function load_file_at

utils.c:646–665  ·  view source on GitHub ↗

Sets errno on error (== NULL), * Always ensures terminating zero */

Source from the content-addressed store, hash-verified

644/* Sets errno on error (== NULL),
645 * Always ensures terminating zero */
646char *
647load_file_at (int dfd,
648 const char *path)
649{
650 int fd;
651 char *data;
652 int errsv;
653
654 fd = TEMP_FAILURE_RETRY (openat (dfd, path, O_CLOEXEC | O_RDONLY));
655 if (fd == -1)
656 return NULL;
657
658 data = load_file_data (fd, NULL);
659
660 errsv = errno;
661 close (fd);
662 errno = errsv;
663
664 return data;
665}
666
667/* Sets errno on error (< 0) */
668int

Callers 3

read_overflowidsFunction · 0.85
mainFunction · 0.85
parse_mountinfoFunction · 0.85

Calls 1

load_file_dataFunction · 0.85

Tested by

no test coverage detected