diff options
| author | 2014-04-12 14:30:13 -0700 | |
|---|---|---|
| committer | 2014-08-22 07:30:42 +0200 | |
| commit | 56fc97c5f344cb4fc88e40e3442f7fa74b5c7003 (patch) | |
| tree | 962106fa320ecd8ac5ccd4bbb69be98203f39a47 /dev | |
| parent | 778256cf50e44da36f4bbf6ee01abb0486a4418f (diff) | |
| download | libimobiledevice-56fc97c5f344cb4fc88e40e3442f7fa74b5c7003.tar.gz libimobiledevice-56fc97c5f344cb4fc88e40e3442f7fa74b5c7003.tar.bz2 | |
filerelaytest: handle error when opening the output file.
Diffstat (limited to 'dev')
| -rw-r--r-- | dev/filerelaytest.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/dev/filerelaytest.c b/dev/filerelaytest.c index b19bbd7..2afa6b6 100644 --- a/dev/filerelaytest.c +++ b/dev/filerelaytest.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | * License along with this library; if not, write to the Free Software | 18 | * License along with this library; if not, write to the Free Software |
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | */ | 20 | */ |
| 21 | #include <err.h> | ||
| 21 | #include <stdio.h> | 22 | #include <stdio.h> |
| 22 | #include <stdlib.h> | 23 | #include <stdlib.h> |
| 23 | #include <libimobiledevice/libimobiledevice.h> | 24 | #include <libimobiledevice/libimobiledevice.h> |
| @@ -100,6 +101,9 @@ int main(int argc, char **argv) | |||
| 100 | uint32_t len = 0; | 101 | uint32_t len = 0; |
| 101 | char buf[4096]; | 102 | char buf[4096]; |
| 102 | FILE *f = fopen("dump.cpio.gz", "wb"); | 103 | FILE *f = fopen("dump.cpio.gz", "wb"); |
| 104 | if (!f) { | ||
| 105 | err(EXIT_FAILURE, "dump.cpio.gz"); | ||
| 106 | } | ||
| 103 | setbuf(stdout, NULL); | 107 | setbuf(stdout, NULL); |
| 104 | printf("receiving "); | 108 | printf("receiving "); |
| 105 | while (idevice_connection_receive(dump, buf, 4096, &len) == IDEVICE_E_SUCCESS) { | 109 | while (idevice_connection_receive(dump, buf, 4096, &len) == IDEVICE_E_SUCCESS) { |
