summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2009-05-20 06:35:14 +0000
committerJay Freeman <saurik@saurik.com>2009-05-20 06:35:14 +0000
commit3885731b631db1a3d641c6e65ad5d052b3b100fb (patch)
tree4d91c9774f720a83fef5a0d5e08eb59fd6085b20 /util
parentee6c27e8cfab18053599fc55d3b12f8a2d13e109 (diff)
Make ldid workaround the stupid inode issue.
git-svn-id: http://svn.telesphoreo.org/trunk@610 514c082c-b64e-11dc-b46d-3d985efe055d
Diffstat (limited to 'util')
-rw-r--r--util/ldid.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/util/ldid.cpp b/util/ldid.cpp
index 334fd1f20..16824d579 100644
--- a/util/ldid.cpp
+++ b/util/ldid.cpp
@@ -780,6 +780,22 @@ int main(int argc, const char *argv[]) {
memset(blob + offset, 0, size - offset);
}
+ if (flag_S) {
+ uint8_t *top = reinterpret_cast<uint8_t *>(framework.GetBase());
+ size_t size = framework.GetSize();
+
+ char *copy;
+ asprintf(&copy, "%s.%s.cp", dir, base);
+ FILE *file = fopen(copy, "w+");
+ size_t writ = fwrite(top, 1, size, file);
+ _assert(writ == size);
+ fclose(file);
+
+ _syscall(unlink(temp));
+ free(temp);
+ temp = copy;
+ }
+
if (temp) {
struct stat info;
_syscall(stat(path, &info));