summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2019-09-28 12:08:12 +0200
committerGravatar Nikias Bassen2019-09-28 12:08:53 +0200
commit8c7321b11512cc3cfd112ad2b4b65c5a81e12bba (patch)
tree306caad40518dbb123051efef3ce06ff3f3b7001
parent92d95d0b8f1870d7cc9eb809a993b04b0e733205 (diff)
downloadlibimobiledevice-8c7321b11512cc3cfd112ad2b4b65c5a81e12bba.tar.gz
libimobiledevice-8c7321b11512cc3cfd112ad2b4b65c5a81e12bba.tar.bz2
tools: Ignore SIGPIPE wherever possible
-rw-r--r--tools/idevice_id.c7
-rw-r--r--tools/idevicecrashreport.c6
-rw-r--r--tools/idevicedate.c6
-rw-r--r--tools/idevicediagnostics.c6
-rw-r--r--tools/ideviceenterrecovery.c6
-rw-r--r--tools/ideviceimagemounter.c6
-rw-r--r--tools/ideviceinfo.c6
-rw-r--r--tools/idevicename.c7
-rw-r--r--tools/idevicepair.c6
-rw-r--r--tools/ideviceprovision.c6
-rw-r--r--tools/idevicescreenshot.c6
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 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#ifndef WIN32
+#include <signal.h>
+#endif
+
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/lockdown.h>
@@ -60,6 +64,9 @@ int main(int argc, char **argv)
int mode = MODE_SHOW_ID;
const char* udid = NULL;
+#ifndef WIN32
+ signal(SIGPIPE, SIG_IGN);
+#endif
/* parse cmdline args */
for (i = 1; i < argc; i++) {
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 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#ifndef WIN32
+#include <signal.h>
+#endif
#include "common/utils.h"
#include <libimobiledevice/libimobiledevice.h>
@@ -322,6 +325,9 @@ int main(int argc, char* argv[])
int i;
const char* udid = NULL;
+#ifndef WIN32
+ signal(SIGPIPE, SIG_IGN);
+#endif
/* parse cmdline args */
for (i = 1; i < argc; i++) {
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 @@
#if HAVE_LANGINFO_CODESET
#include <langinfo.h>
#endif
+#ifndef WIN32
+#include <signal.h>
+#endif
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/lockdown.h>
@@ -76,6 +79,9 @@ int main(int argc, char *argv[])
char buffer[80];
int result = 0;
+#ifndef WIN32
+ signal(SIGPIPE, SIG_IGN);
+#endif
/* parse cmdline args */
for (i = 1; i < argc; i++) {
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 @@
#include <stdlib.h>
#include <errno.h>
#include <time.h>
+#ifndef WIN32
+#include <signal.h>
+#endif
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/lockdown.h>
@@ -71,6 +74,9 @@ int main(int argc, char **argv)
plist_t node = NULL;
plist_t keys = NULL;
+#ifndef WIN32
+ signal(SIGPIPE, SIG_IGN);
+#endif
/* parse cmdline args */
for (i = 1; i < argc; i++) {
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 @@
#include <string.h>
#include <errno.h>
#include <stdlib.h>
+#ifndef WIN32
+#include <signal.h>
+#endif
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/lockdown.h>
@@ -53,6 +56,9 @@ int main(int argc, char *argv[])
int i;
const char* udid = NULL;
+#ifndef WIN32
+ signal(SIGPIPE, SIG_IGN);
+#endif
/* parse cmdline args */
for (i = 1; i < argc; i++) {
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 @@
#include <time.h>
#include <sys/time.h>
#include <inttypes.h>
+#ifndef WIN32
+#include <signal.h>
+#endif
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/lockdown.h>
@@ -153,6 +156,9 @@ int main(int argc, char **argv)
size_t image_size = 0;
char *image_sig_path = NULL;
+#ifndef WIN32
+ signal(SIGPIPE, SIG_IGN);
+#endif
parse_opts(argc, argv);
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 @@
#include <string.h>
#include <errno.h>
#include <stdlib.h>
+#ifndef WIN32
+#include <signal.h>
+#endif
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/lockdown.h>
@@ -121,6 +124,9 @@ int main(int argc, char *argv[])
uint32_t xml_length;
plist_t node = NULL;
+#ifndef WIN32
+ signal(SIGPIPE, SIG_IGN);
+#endif
/* parse cmdline args */
for (i = 1; i < argc; i++) {
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 @@
#include <unistd.h>
#include <stdlib.h>
#include <getopt.h>
+#ifndef WIN32
+#include <signal.h>
+#endif
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/lockdown.h>
@@ -57,6 +60,10 @@ int main(int argc, char** argv)
{ NULL, 0, NULL, 0}
};
+#ifndef WIN32
+ signal(SIGPIPE, SIG_IGN);
+#endif
+
while ((c = getopt_long(argc, argv, "du:h", longopts, &optidx)) != -1) {
switch (c) {
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 @@
#include <string.h>
#include <stdlib.h>
#include <getopt.h>
+#ifndef WIN32
+#include <signal.h>
+#endif
#include "common/userpref.h"
#include <libimobiledevice/libimobiledevice.h>
@@ -134,6 +137,9 @@ int main(int argc, char **argv)
} op_t;
op_t op = OP_NONE;
+#ifndef WIN32
+ signal(SIGPIPE, SIG_IGN);
+#endif
parse_opts(argc, argv);
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 @@
#include <string.h>
#include <sys/stat.h>
#include <errno.h>
+#ifndef WIN32
+#include <signal.h>
+#endif
#ifdef WIN32
#include <windows.h>
@@ -291,6 +294,9 @@ int main(int argc, char *argv[])
const char* param = NULL;
const char* param2 = NULL;
+#ifndef WIN32
+ signal(SIGPIPE, SIG_IGN);
+#endif
/* parse cmdline args */
for (i = 1; i < argc; i++) {
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 @@
#include <stdlib.h>
#include <errno.h>
#include <time.h>
+#ifndef WIN32
+#include <signal.h>
+#endif
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/lockdown.h>
@@ -47,6 +50,9 @@ int main(int argc, char **argv)
const char *udid = NULL;
char *filename = NULL;
+#ifndef WIN32
+ signal(SIGPIPE, SIG_IGN);
+#endif
/* parse cmdline args */
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) {