X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=lib%2Fsystem%2Fsystem.c;h=0253ac8778e32242bf055d2a3eadbcede4ba1920;hp=6e80b24ec1eaac9176629af6799f292546c668a1;hb=2e97d0eea0d8a480877a1aabb4c67ad1aad59ed1;hpb=51c6aaf7864eb65779d548ee2549caa357f71e2c diff --git a/lib/system/system.c b/lib/system/system.c index 6e80b24..0253ac8 100644 --- a/lib/system/system.c +++ b/lib/system/system.c @@ -30,6 +30,12 @@ const struct pb_system_apps pb_system_apps = { .udhcpc = HOST_PROG_UDHCPC, }; +#ifndef TFTP_TYPE +#define TFTP_TYPE TFTP_TYPE_UNKNOWN +#endif + +enum tftp_type tftp_type = TFTP_TYPE; + int pb_mkdir_recursive(const char *dir) { struct stat statbuf; @@ -85,12 +91,12 @@ int pb_rmdir_recursive(const char *base, const char *dir) cur = talloc_strdup(NULL, dir); - while (strcmp(base, dir)) { + while (strcmp(base, cur)) { - rmdir(dir); + rmdir(cur); /* null-terminate at the last slash */ - pos = strrchr(dir, '/'); + pos = strrchr(cur, '/'); if (!pos) break;