MCPcopy Create free account
hub / github.com/coreboot/coreboot / mkpath

Function mkpath

util/cbmem/cbmem.c:974–989  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

972};
973
974static int mkpath(char *path, mode_t mode)
975{
976 assert (path && *path);
977 char *p;
978 for (p = strchr(path+1, '/'); p; p = strchr(p + 1, '/')) {
979 *p = '\0';
980 if (mkdir(path, mode) == -1) {
981 if (errno != EEXIST) {
982 *p = '/';
983 return -1;
984 }
985 }
986 *p = '/';
987 }
988 return 0;
989}
990
991static void dump_coverage(void)
992{

Callers 1

dump_coverageFunction · 0.85

Calls 1

strchrFunction · 0.50

Tested by

no test coverage detected