diff options
| author | 2019-09-28 12:08:12 +0200 | |
|---|---|---|
| committer | 2019-09-28 12:08:53 +0200 | |
| commit | 8c7321b11512cc3cfd112ad2b4b65c5a81e12bba (patch) | |
| tree | 306caad40518dbb123051efef3ce06ff3f3b7001 /tools | |
| parent | 92d95d0b8f1870d7cc9eb809a993b04b0e733205 (diff) | |
| download | libimobiledevice-8c7321b11512cc3cfd112ad2b4b65c5a81e12bba.tar.gz libimobiledevice-8c7321b11512cc3cfd112ad2b4b65c5a81e12bba.tar.bz2 | |
tools: Ignore SIGPIPE wherever possible
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/idevice_id.c | 7 | ||||
| -rw-r--r-- | tools/idevicecrashreport.c | 6 | ||||
| -rw-r--r-- | tools/idevicedate.c | 6 | ||||
| -rw-r--r-- | tools/idevicediagnostics.c | 6 | ||||
| -rw-r--r-- | tools/ideviceenterrecovery.c | 6 | ||||
| -rw-r--r-- | tools/ideviceimagemounter.c | 6 | ||||
| -rw-r--r-- | tools/ideviceinfo.c | 6 | ||||
| -rw-r--r-- | tools/idevicename.c | 7 | ||||
| -rw-r--r-- | tools/idevicepair.c | 6 | ||||
| -rw-r--r-- | tools/ideviceprovision.c | 6 | ||||
| -rw-r--r-- | tools/idevicescreenshot.c | 6 |
11 files changed, 68 insertions, 0 deletions
diff --git a/tools/idevice_id.c b/tools/idevice_id.c index 558dcbe..8d888c0 100644 --- a/tools/idevice_id.c +++ b/tools/idevice_id.c | |||
| @@ -26,6 +26,10 @@ | |||
| 26 | #include <stdio.h> | 26 | #include <stdio.h> |
| 27 | #include <string.h> | 27 | #include <string.h> |
| 28 | #include <stdlib.h> | 28 | #include <stdlib.h> |
| 29 | #ifndef WIN32 | ||
| 30 | #include <signal.h> | ||
| 31 | #endif | ||
| 32 | |||
| 29 | #include <libimobiledevice/libimobiledevice.h> | 33 | #include <libimobiledevice/libimobiledevice.h> |
| 30 | #include <libimobiledevice/lockdown.h> | 34 | #include <libimobiledevice/lockdown.h> |
| 31 | 35 | ||
| @@ -60,6 +64,9 @@ int main(int argc, char **argv) | |||
| 60 | int mode = MODE_SHOW_ID; | 64 | int mode = MODE_SHOW_ID; |
| 61 | const char* udid = NULL; | 65 | const char* udid = NULL; |
| 62 | 66 | ||
| 67 | #ifndef WIN32 | ||
| 68 | signal(SIGPIPE, SIG_IGN); | ||
| 69 | #endif | ||
| 63 | /* parse cmdline args */ | 70 | /* parse cmdline args */ |
| 64 | for (i = 1; i < argc; i++) { | 71 | for (i = 1; i < argc; i++) { |
| 65 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { | 72 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { |
diff --git a/tools/idevicecrashreport.c b/tools/idevicecrashreport.c index 533265c..5d2e21d 100644 --- a/tools/idevicecrashreport.c +++ b/tools/idevicecrashreport.c | |||
| @@ -28,6 +28,9 @@ | |||
| 28 | #include <stdlib.h> | 28 | #include <stdlib.h> |
| 29 | #include <string.h> | 29 | #include <string.h> |
| 30 | #include <unistd.h> | 30 | #include <unistd.h> |
| 31 | #ifndef WIN32 | ||
| 32 | #include <signal.h> | ||
| 33 | #endif | ||
| 31 | #include "common/utils.h" | 34 | #include "common/utils.h" |
| 32 | 35 | ||
| 33 | #include <libimobiledevice/libimobiledevice.h> | 36 | #include <libimobiledevice/libimobiledevice.h> |
| @@ -322,6 +325,9 @@ int main(int argc, char* argv[]) | |||
| 322 | int i; | 325 | int i; |
| 323 | const char* udid = NULL; | 326 | const char* udid = NULL; |
| 324 | 327 | ||
| 328 | #ifndef WIN32 | ||
| 329 | signal(SIGPIPE, SIG_IGN); | ||
| 330 | #endif | ||
| 325 | /* parse cmdline args */ | 331 | /* parse cmdline args */ |
| 326 | for (i = 1; i < argc; i++) { | 332 | for (i = 1; i < argc; i++) { |
| 327 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { | 333 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { |
diff --git a/tools/idevicedate.c b/tools/idevicedate.c index 2676880..4de90b6 100644 --- a/tools/idevicedate.c +++ b/tools/idevicedate.c | |||
| @@ -30,6 +30,9 @@ | |||
| 30 | #if HAVE_LANGINFO_CODESET | 30 | #if HAVE_LANGINFO_CODESET |
| 31 | #include <langinfo.h> | 31 | #include <langinfo.h> |
| 32 | #endif | 32 | #endif |
| 33 | #ifndef WIN32 | ||
| 34 | #include <signal.h> | ||
| 35 | #endif | ||
| 33 | 36 | ||
| 34 | #include <libimobiledevice/libimobiledevice.h> | 37 | #include <libimobiledevice/libimobiledevice.h> |
| 35 | #include <libimobiledevice/lockdown.h> | 38 | #include <libimobiledevice/lockdown.h> |
| @@ -76,6 +79,9 @@ int main(int argc, char *argv[]) | |||
| 76 | char buffer[80]; | 79 | char buffer[80]; |
| 77 | int result = 0; | 80 | int result = 0; |
| 78 | 81 | ||
| 82 | #ifndef WIN32 | ||
| 83 | signal(SIGPIPE, SIG_IGN); | ||
| 84 | #endif | ||
| 79 | /* parse cmdline args */ | 85 | /* parse cmdline args */ |
| 80 | for (i = 1; i < argc; i++) { | 86 | for (i = 1; i < argc; i++) { |
| 81 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { | 87 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { |
diff --git a/tools/idevicediagnostics.c b/tools/idevicediagnostics.c index 08e7c5e..bff1e1d 100644 --- a/tools/idevicediagnostics.c +++ b/tools/idevicediagnostics.c | |||
| @@ -28,6 +28,9 @@ | |||
| 28 | #include <stdlib.h> | 28 | #include <stdlib.h> |
| 29 | #include <errno.h> | 29 | #include <errno.h> |
| 30 | #include <time.h> | 30 | #include <time.h> |
| 31 | #ifndef WIN32 | ||
| 32 | #include <signal.h> | ||
| 33 | #endif | ||
| 31 | 34 | ||
| 32 | #include <libimobiledevice/libimobiledevice.h> | 35 | #include <libimobiledevice/libimobiledevice.h> |
| 33 | #include <libimobiledevice/lockdown.h> | 36 | #include <libimobiledevice/lockdown.h> |
| @@ -71,6 +74,9 @@ int main(int argc, char **argv) | |||
| 71 | plist_t node = NULL; | 74 | plist_t node = NULL; |
| 72 | plist_t keys = NULL; | 75 | plist_t keys = NULL; |
| 73 | 76 | ||
| 77 | #ifndef WIN32 | ||
| 78 | signal(SIGPIPE, SIG_IGN); | ||
| 79 | #endif | ||
| 74 | /* parse cmdline args */ | 80 | /* parse cmdline args */ |
| 75 | for (i = 1; i < argc; i++) { | 81 | for (i = 1; i < argc; i++) { |
| 76 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { | 82 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { |
diff --git a/tools/ideviceenterrecovery.c b/tools/ideviceenterrecovery.c index 69484cc..ec9093b 100644 --- a/tools/ideviceenterrecovery.c +++ b/tools/ideviceenterrecovery.c | |||
| @@ -27,6 +27,9 @@ | |||
| 27 | #include <string.h> | 27 | #include <string.h> |
| 28 | #include <errno.h> | 28 | #include <errno.h> |
| 29 | #include <stdlib.h> | 29 | #include <stdlib.h> |
| 30 | #ifndef WIN32 | ||
| 31 | #include <signal.h> | ||
| 32 | #endif | ||
| 30 | 33 | ||
| 31 | #include <libimobiledevice/libimobiledevice.h> | 34 | #include <libimobiledevice/libimobiledevice.h> |
| 32 | #include <libimobiledevice/lockdown.h> | 35 | #include <libimobiledevice/lockdown.h> |
| @@ -53,6 +56,9 @@ int main(int argc, char *argv[]) | |||
| 53 | int i; | 56 | int i; |
| 54 | const char* udid = NULL; | 57 | const char* udid = NULL; |
| 55 | 58 | ||
| 59 | #ifndef WIN32 | ||
| 60 | signal(SIGPIPE, SIG_IGN); | ||
| 61 | #endif | ||
| 56 | /* parse cmdline args */ | 62 | /* parse cmdline args */ |
| 57 | for (i = 1; i < argc; i++) { | 63 | for (i = 1; i < argc; i++) { |
| 58 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { | 64 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { |
diff --git a/tools/ideviceimagemounter.c b/tools/ideviceimagemounter.c index 93cab09..74df5e4 100644 --- a/tools/ideviceimagemounter.c +++ b/tools/ideviceimagemounter.c | |||
| @@ -34,6 +34,9 @@ | |||
| 34 | #include <time.h> | 34 | #include <time.h> |
| 35 | #include <sys/time.h> | 35 | #include <sys/time.h> |
| 36 | #include <inttypes.h> | 36 | #include <inttypes.h> |
| 37 | #ifndef WIN32 | ||
| 38 | #include <signal.h> | ||
| 39 | #endif | ||
| 37 | 40 | ||
| 38 | #include <libimobiledevice/libimobiledevice.h> | 41 | #include <libimobiledevice/libimobiledevice.h> |
| 39 | #include <libimobiledevice/lockdown.h> | 42 | #include <libimobiledevice/lockdown.h> |
| @@ -153,6 +156,9 @@ int main(int argc, char **argv) | |||
| 153 | size_t image_size = 0; | 156 | size_t image_size = 0; |
| 154 | char *image_sig_path = NULL; | 157 | char *image_sig_path = NULL; |
| 155 | 158 | ||
| 159 | #ifndef WIN32 | ||
| 160 | signal(SIGPIPE, SIG_IGN); | ||
| 161 | #endif | ||
| 156 | parse_opts(argc, argv); | 162 | parse_opts(argc, argv); |
| 157 | 163 | ||
| 158 | argc -= optind; | 164 | argc -= optind; |
diff --git a/tools/ideviceinfo.c b/tools/ideviceinfo.c index 59fade8..a1124cf 100644 --- a/tools/ideviceinfo.c +++ b/tools/ideviceinfo.c | |||
| @@ -27,6 +27,9 @@ | |||
| 27 | #include <string.h> | 27 | #include <string.h> |
| 28 | #include <errno.h> | 28 | #include <errno.h> |
| 29 | #include <stdlib.h> | 29 | #include <stdlib.h> |
| 30 | #ifndef WIN32 | ||
| 31 | #include <signal.h> | ||
| 32 | #endif | ||
| 30 | 33 | ||
| 31 | #include <libimobiledevice/libimobiledevice.h> | 34 | #include <libimobiledevice/libimobiledevice.h> |
| 32 | #include <libimobiledevice/lockdown.h> | 35 | #include <libimobiledevice/lockdown.h> |
| @@ -121,6 +124,9 @@ int main(int argc, char *argv[]) | |||
| 121 | uint32_t xml_length; | 124 | uint32_t xml_length; |
| 122 | plist_t node = NULL; | 125 | plist_t node = NULL; |
| 123 | 126 | ||
| 127 | #ifndef WIN32 | ||
| 128 | signal(SIGPIPE, SIG_IGN); | ||
| 129 | #endif | ||
| 124 | /* parse cmdline args */ | 130 | /* parse cmdline args */ |
| 125 | for (i = 1; i < argc; i++) { | 131 | for (i = 1; i < argc; i++) { |
| 126 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { | 132 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { |
diff --git a/tools/idevicename.c b/tools/idevicename.c index ef226f7..a66f5aa 100644 --- a/tools/idevicename.c +++ b/tools/idevicename.c | |||
| @@ -28,6 +28,9 @@ | |||
| 28 | #include <unistd.h> | 28 | #include <unistd.h> |
| 29 | #include <stdlib.h> | 29 | #include <stdlib.h> |
| 30 | #include <getopt.h> | 30 | #include <getopt.h> |
| 31 | #ifndef WIN32 | ||
| 32 | #include <signal.h> | ||
| 33 | #endif | ||
| 31 | 34 | ||
| 32 | #include <libimobiledevice/libimobiledevice.h> | 35 | #include <libimobiledevice/libimobiledevice.h> |
| 33 | #include <libimobiledevice/lockdown.h> | 36 | #include <libimobiledevice/lockdown.h> |
| @@ -57,6 +60,10 @@ int main(int argc, char** argv) | |||
| 57 | { NULL, 0, NULL, 0} | 60 | { NULL, 0, NULL, 0} |
| 58 | }; | 61 | }; |
| 59 | 62 | ||
| 63 | #ifndef WIN32 | ||
| 64 | signal(SIGPIPE, SIG_IGN); | ||
| 65 | #endif | ||
| 66 | |||
| 60 | while ((c = getopt_long(argc, argv, "du:h", longopts, &optidx)) != -1) { | 67 | while ((c = getopt_long(argc, argv, "du:h", longopts, &optidx)) != -1) { |
| 61 | switch (c) { | 68 | switch (c) { |
| 62 | case 'u': | 69 | case 'u': |
diff --git a/tools/idevicepair.c b/tools/idevicepair.c index be1f373..bc0f5d8 100644 --- a/tools/idevicepair.c +++ b/tools/idevicepair.c | |||
| @@ -28,6 +28,9 @@ | |||
| 28 | #include <string.h> | 28 | #include <string.h> |
| 29 | #include <stdlib.h> | 29 | #include <stdlib.h> |
| 30 | #include <getopt.h> | 30 | #include <getopt.h> |
| 31 | #ifndef WIN32 | ||
| 32 | #include <signal.h> | ||
| 33 | #endif | ||
| 31 | #include "common/userpref.h" | 34 | #include "common/userpref.h" |
| 32 | 35 | ||
| 33 | #include <libimobiledevice/libimobiledevice.h> | 36 | #include <libimobiledevice/libimobiledevice.h> |
| @@ -134,6 +137,9 @@ int main(int argc, char **argv) | |||
| 134 | } op_t; | 137 | } op_t; |
| 135 | op_t op = OP_NONE; | 138 | op_t op = OP_NONE; |
| 136 | 139 | ||
| 140 | #ifndef WIN32 | ||
| 141 | signal(SIGPIPE, SIG_IGN); | ||
| 142 | #endif | ||
| 137 | parse_opts(argc, argv); | 143 | parse_opts(argc, argv); |
| 138 | 144 | ||
| 139 | if ((argc - optind) < 1) { | 145 | if ((argc - optind) < 1) { |
diff --git a/tools/ideviceprovision.c b/tools/ideviceprovision.c index 52efdeb..7e8367a 100644 --- a/tools/ideviceprovision.c +++ b/tools/ideviceprovision.c | |||
| @@ -29,6 +29,9 @@ | |||
| 29 | #include <string.h> | 29 | #include <string.h> |
| 30 | #include <sys/stat.h> | 30 | #include <sys/stat.h> |
| 31 | #include <errno.h> | 31 | #include <errno.h> |
| 32 | #ifndef WIN32 | ||
| 33 | #include <signal.h> | ||
| 34 | #endif | ||
| 32 | 35 | ||
| 33 | #ifdef WIN32 | 36 | #ifdef WIN32 |
| 34 | #include <windows.h> | 37 | #include <windows.h> |
| @@ -291,6 +294,9 @@ int main(int argc, char *argv[]) | |||
| 291 | const char* param = NULL; | 294 | const char* param = NULL; |
| 292 | const char* param2 = NULL; | 295 | const char* param2 = NULL; |
| 293 | 296 | ||
| 297 | #ifndef WIN32 | ||
| 298 | signal(SIGPIPE, SIG_IGN); | ||
| 299 | #endif | ||
| 294 | /* parse cmdline args */ | 300 | /* parse cmdline args */ |
| 295 | for (i = 1; i < argc; i++) { | 301 | for (i = 1; i < argc; i++) { |
| 296 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { | 302 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { |
diff --git a/tools/idevicescreenshot.c b/tools/idevicescreenshot.c index f2bcd48..38d323c 100644 --- a/tools/idevicescreenshot.c +++ b/tools/idevicescreenshot.c | |||
| @@ -28,6 +28,9 @@ | |||
| 28 | #include <stdlib.h> | 28 | #include <stdlib.h> |
| 29 | #include <errno.h> | 29 | #include <errno.h> |
| 30 | #include <time.h> | 30 | #include <time.h> |
| 31 | #ifndef WIN32 | ||
| 32 | #include <signal.h> | ||
| 33 | #endif | ||
| 31 | 34 | ||
| 32 | #include <libimobiledevice/libimobiledevice.h> | 35 | #include <libimobiledevice/libimobiledevice.h> |
| 33 | #include <libimobiledevice/lockdown.h> | 36 | #include <libimobiledevice/lockdown.h> |
| @@ -47,6 +50,9 @@ int main(int argc, char **argv) | |||
| 47 | const char *udid = NULL; | 50 | const char *udid = NULL; |
| 48 | char *filename = NULL; | 51 | char *filename = NULL; |
| 49 | 52 | ||
| 53 | #ifndef WIN32 | ||
| 54 | signal(SIGPIPE, SIG_IGN); | ||
| 55 | #endif | ||
| 50 | /* parse cmdline args */ | 56 | /* parse cmdline args */ |
| 51 | for (i = 1; i < argc; i++) { | 57 | for (i = 1; i < argc; i++) { |
| 52 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { | 58 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { |
