MCPcopy Create free account
hub / github.com/apache/nuttx / verify_file

Function verify_file

tools/configure.c:523–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

521}
522
523static bool verify_file(const char *path)
524{
525 struct stat buf;
526
527 if (stat(path, &buf) < 0)
528 {
529 /* It may be okay if the file does not exist */
530
531 int errcode = errno;
532 if (errcode == ENOENT)
533 {
534 debug("verify_file: stat of %s failed: %s\n",
535 path, strerror(errno));
536 return false;
537 }
538 else
539 {
540 fprintf(stderr, "ERROR: stat of %s failed: %s\n",
541 path, strerror(errno));
542 exit(EXIT_FAILURE);
543 }
544 }
545
546 if (!S_ISREG(buf.st_mode))
547 {
548 fprintf(stderr, "ERROR: %s exists but is not a regular file\n", path);
549 exit(EXIT_FAILURE);
550 }
551
552 return true;
553}
554
555static void find_topdir(void)
556{

Callers 3

check_configuredFunction · 0.85
check_configurationFunction · 0.85
copy_optionalFunction · 0.85

Calls 5

strerrorFunction · 0.85
fprintfFunction · 0.85
exitFunction · 0.85
statClass · 0.70
debugFunction · 0.70

Tested by

no test coverage detected