Otherwise opening .extroot-uuid could fail.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
char tag[64];
char uuid[64] = { 0 };
char tag[64];
char uuid[64] = { 0 };
+ snprintf(tag, sizeof(tag), "%s/etc", path);
+ if (stat(tag, &s))
+ mkdir_p(tag);
+
snprintf(tag, sizeof(tag), "%s/etc/.extroot-uuid", path);
if (stat(tag, &s)) {
fp = fopen(tag, "w+");
snprintf(tag, sizeof(tag), "%s/etc/.extroot-uuid", path);
if (stat(tag, &s)) {
fp = fopen(tag, "w+");