From 56fc97c5f344cb4fc88e40e3442f7fa74b5c7003 Mon Sep 17 00:00:00 2001 From: Aaron Burghardt Date: Sat, 12 Apr 2014 14:30:13 -0700 Subject: filerelaytest: handle error when opening the output file. --- dev/filerelaytest.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dev') 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 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include #include @@ -100,6 +101,9 @@ int main(int argc, char **argv) uint32_t len = 0; char buf[4096]; FILE *f = fopen("dump.cpio.gz", "wb"); + if (!f) { + err(EXIT_FAILURE, "dump.cpio.gz"); + } setbuf(stdout, NULL); printf("receiving "); while (idevice_connection_receive(dump, buf, 4096, &len) == IDEVICE_E_SUCCESS) { -- cgit v1.1-32-gdbae