.wget = HOST_PROG_WGET,
.ip = HOST_PROG_IP,
.udhcpc = HOST_PROG_UDHCPC,
+ .udhcpc6 = HOST_PROG_UDHCPC6,
+ .vgscan = HOST_PROG_VGSCAN,
+ .vgchange = HOST_PROG_VGCHANGE,
+ .pb_plugin = HOST_PROG_PB_PLUGIN,
+ .pb_exec = HOST_PROG_PB_EXEC,
+ .sh = HOST_PROG_SH,
+ .scsi_rescan = HOST_PROG_SCSI_RESCAN,
+ .dmidecode = HOST_PROG_DMIDECODE,
};
#ifndef TFTP_TYPE
int pb_mkdir_recursive(const char *dir)
{
struct stat statbuf;
+ int rc, mode = 0755;
char *str, *sep;
- int mode = 0755;
if (!*dir)
return 0;
str = talloc_strdup(NULL, dir);
sep = strchr(*str == '/' ? str + 1 : str, '/');
+ rc = 0;
+
while (1) {
/* terminate the path at sep */
if (mkdir(str, mode) && errno != EEXIST) {
pb_log("mkdir(%s): %s\n", str, strerror(errno));
- return -1;
+ rc = -1;
+ break;
}
if (!sep)
talloc_free(str);
- return 0;
+ return rc;
}
int pb_rmdir_recursive(const char *base, const char *dir)