Merge remote-tracking branch 'origin/master'

This commit is contained in:
tihmstar 2016-12-05 12:38:40 +01:00
commit 9da54b1db7
4 changed files with 14 additions and 4 deletions

View file

@ -23,6 +23,14 @@
#include "restore.h"
#include "tsschecker.h"
#ifdef WIN32
#include <windows.h>
#define __mkdir(path, mode) mkdir(path)
#else
#include <sys/stat.h>
#define __mkdir(path, mode) mkdir(path, mode)
#endif
#define NONCESIZE 20
#define USEC_PER_SEC 1000000
@ -44,7 +52,7 @@ futurerestore::futurerestore(){
if (_client == NULL) throw std::string("could not create idevicerestore client\n");
struct stat st{0};
if (stat(FUTURERESTORE_TMP_PATH, &st) == -1) mkdir(FUTURERESTORE_TMP_PATH, 0755);
if (stat(FUTURERESTORE_TMP_PATH, &st) == -1) __mkdir(FUTURERESTORE_TMP_PATH, 0755);
//tsschecker nocache
nocache = 1;
@ -658,7 +666,7 @@ char *futurerestore::getPathOfElementInManifest(const char *element, const char
char *pathStr = NULL;
ptr_smart<plist_t> buildmanifest(NULL,plist_free);
plist_from_xml(manifeststr, (uint)strlen(manifeststr), &buildmanifest);
plist_from_xml(manifeststr, (uint32_t)strlen(manifeststr), &buildmanifest);
if (plist_t buildidentities = plist_dict_get_item(buildmanifest._p, "BuildIdentities"))
if (plist_t firstIdentitie = plist_array_get_item(buildidentities, 0))

View file

@ -11,6 +11,7 @@
#include "config.h"
#include <stdio.h>
#include <functional>
#include "idevicerestore.h"
#include "jsmn.h"
@ -18,7 +19,7 @@ using namespace std;
template <typename T>
class ptr_smart {
function<void(T)> _ptr_free = NULL;
std::function<void(T)> _ptr_free = NULL;
public:
T _p;
ptr_smart(T p, function<void(T)> ptr_free){static_assert(is_pointer<T>(), "error: this is for pointers only\n"); _p = p;_ptr_free = ptr_free;}

View file

@ -8,6 +8,7 @@
#include <iostream>
#include <getopt.h>
#include <string.h>
#include "futurerestore.hpp"
#include "all_tsschecker.h"
#include "tsschecker.h"