| 1 |
Fromscip-debian debian usbmuxd 1.1.1-7 usbmuxd/patches/`0003-Port-to-libplist-2.3.0.patch`#From.: Boyuan Yang <[email protected]scip-debian . . . identity/`[email protected]`.> |
| 2 |
Datescip-debian debian usbmuxd 1.1.1-7 usbmuxd/patches/`0003-Port-to-libplist-2.3.0.patch`#Date.: Thu, 3 Aug 2023 16:07:40 -0400 |
| 3 |
Subjectscip-debian debian usbmuxd 1.1.1-7 usbmuxd/patches/`0003-Port-to-libplist-2.3.0.patch`#Subject.: Port to libplist 2.3.0 |
| 4 |
|
| 5 |
--- |
| 6 |
configure.ac | 2 +- |
| 7 |
src/conf.c | 9 +++++---- |
| 8 |
src/utils.c | 45 --------------------------------------------- |
| 9 |
src/utils.h | 8 -------- |
| 10 |
4 files changed, 6 insertions(+), 58 deletions(-) |
| 11 |
|
| 12 |
diff --git a/configure.acscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`configure.ac`: b/configure.acscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`configure.ac`: |
| 13 |
index af0d2cd..3f8493c 100644 |
| 14 |
--- a/configure.ac |
| 15 |
+++ b/configure.ac |
| 16 |
@@ -17,7 +17,7 @@ AC_PROG_LIBTOOL |
| 17 |
|
| 18 |
# Checks for libraries. |
| 19 |
PKG_CHECK_MODULES(libusb, libusb-1.0 >= 1.0.9) |
| 20 |
|
| 21 |
+PKG_CHECK_MODULES(libplist, libplist-2.0 >= 2.3.0) |
| 22 |
PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.3.0, have_limd=yes, have_limd=no) |
| 23 |
AC_CHECK_LIB(pthread, [pthread_create, pthread_mutex_lock], [AC_SUBST(libpthread_LIBS,[-lpthread])], [AC_MSG_ERROR([libpthread is required to build usbmuxd])]) |
| 24 |
|
| 25 |
diff --git a/src/conf.cscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`src/conf.c`: b/src/conf.cscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`src/conf.c`: |
| 26 |
index 609d246..5e682b4 100644 |
| 27 |
--- a/src/conf.c |
| 28 |
+++ b/src/conf.c |
| 29 |
@@ -39,6 +39,7 @@ |
| 30 |
#include <shlobj.h> |
| 31 |
#endif |
| 32 |
|
| 33 |
+#include <plist/plist.h> |
| 34 |
#include "conf.h" |
| 35 |
#include "utils.h" |
| 36 |
#include "log.h" |
| 37 |
@@ -230,7 +231,7 @@ static int internal_set_value(const char *config_file, const char *key, plist_t |
| 38 |
/* read file into plist */ |
| 39 |
plist_t config = NULL; |
| 40 |
|
| 41 |
|
| 42 |
+ plist_read_from_file(config_file, &config, NULL); |
| 43 |
if (!config) { |
| 44 |
config = plist_new_dict(); |
| 45 |
plist_dict_set_item(config, key, value); |
| 46 |
@@ -254,7 +255,7 @@ static int internal_set_value(const char *config_file, const char *key, plist_t |
| 47 |
usbmuxd_log(LL_DEBUG, "Setting key %s in config file %s", key, config_file); |
| 48 |
} |
| 49 |
|
| 50 |
|
| 51 |
+ int res = plist_write_to_file(config, config_file, PLIST_FORMAT_XML, 0); |
| 52 |
|
| 53 |
plist_free(config); |
| 54 |
|
| 55 |
@@ -288,7 +289,7 @@ static int internal_get_value(const char* config_file, const char *key, plist_t |
| 56 |
|
| 57 |
/* now parse file to get the SystemBUID */ |
| 58 |
plist_t config = NULL; |
| 59 |
|
| 60 |
+ if (plist_read_from_file(config_file, &config, NULL)) { |
| 61 |
usbmuxd_log(LL_DEBUG, "Reading key %s from config file %s", key, config_file); |
| 62 |
plist_t n = plist_dict_get_item(config, key); |
| 63 |
if (n) { |
| 64 |
@@ -428,7 +429,7 @@ int config_set_device_record(const char *udid, char* record_data, uint64_t recor |
| 65 |
remove(device_record_file); |
| 66 |
|
| 67 |
/* store file */ |
| 68 |
|
| 69 |
+ if (!plist_write_to_file(plist, device_record_file, PLIST_FORMAT_XML, 0)) { |
| 70 |
usbmuxd_log(LL_DEBUG, "Could not open '%s' for writing: %s", device_record_file, strerror(errno)); |
| 71 |
res = -ENOENT; |
| 72 |
} |
| 73 |
diff --git a/src/utils.cscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`src/utils.c`: b/src/utils.cscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`src/utils.c`: |
| 74 |
index 206c684..35d3f73 100644 |
| 75 |
--- a/src/utils.c |
| 76 |
+++ b/src/utils.c |
| 77 |
@@ -279,51 +279,6 @@ int buffer_write_to_filename(const char *filename, const char *buffer, uint64_t |
| 78 |
} |
| 79 |
} |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
#ifndef HAVE_CLOCK_GETTIME |
| 127 |
typedef int clockid_t; |
| 128 |
#define CLOCK_MONOTONIC 1 |
| 129 |
diff --git a/src/utils.hscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`src/utils.h`: b/src/utils.hscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`src/utils.h`: |
| 130 |
index b5cab3f..4fbd3af 100644 |
| 131 |
--- a/src/utils.h |
| 132 |
+++ b/src/utils.h |
| 133 |
@@ -78,14 +78,6 @@ char *string_concat(const char *str, ...); |
| 134 |
int buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length); |
| 135 |
int buffer_write_to_filename(const char *filename, const char *buffer, uint64_t length); |
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
uint64_t mstime64(void); |
| 146 |
void get_tick_count(struct timeval * tv); |
| 147 |
|