Revision e7c5e893 libcacard/vscclient.c

b/libcacard/vscclient.c
357 357
    if (sock < 0) {
358 358
        /* Error */
359 359
        fprintf(stderr, "Error opening socket!\n");
360
        return -1;
360 361
    }
361 362

  
362 363
    memset(&hints, 0, sizeof(struct addrinfo));
......
370 371
    if (ret != 0) {
371 372
        /* Error */
372 373
        fprintf(stderr, "getaddrinfo failed\n");
373
        return 5;
374
        return -1;
374 375
    }
375 376

  
376 377
    if (connect(sock, server->ai_addr, server->ai_addrlen) < 0) {
377 378
        /* Error */
378 379
        fprintf(stderr, "Could not connect\n");
379
        return 5;
380
        return -1;
380 381
    }
381 382
    if (verbose) {
382 383
        printf("Connected (sizeof Header=%zd)!\n", sizeof(VSCMsgHeader));
......
505 506
    qemu_host = strdup(argv[argc - 2]);
506 507
    qemu_port = strdup(argv[argc - 1]);
507 508
    sock = connect_to_qemu(qemu_host, qemu_port);
509
    if (sock == -1) {
510
        fprintf(stderr, "error opening socket, exiting.\n");
511
        exit(5);
512
    }
508 513

  
509 514
    qemu_mutex_init(&write_lock);
510 515
    qemu_mutex_init(&pending_reader_lock);

Also available in: Unified diff