summaryrefslogtreecommitdiff
path: root/util/sconfig/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/sconfig/main.c')
-rwxr-xr-xutil/sconfig/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/util/sconfig/main.c b/util/sconfig/main.c
index c3448f35b5..dab04db321 100755
--- a/util/sconfig/main.c
+++ b/util/sconfig/main.c
@@ -131,6 +131,13 @@ struct device *new_chip(struct device *parent, struct device *bus, char *path) {
struct stat st;
char *chip_h = malloc(strlen(path)+12);
+ sprintf(chip_h, "src/%s", path);
+ if ((stat(chip_h, &st) == -1) && (errno == ENOENT)) {
+ fprintf(stderr, "ERROR: Chip component %s does not exist.\n",
+ path);
+ exit(1);
+ }
+
sprintf(chip_h, "src/%s/chip.h", path);
if ((stat(chip_h, &st) == -1) && (errno == ENOENT))
new_chip->chiph_exists = 0;