~ubuntu-branches/ubuntu/trusty/openipmi/trusty-updates

« back to all changes in this revision

Viewing changes to sample/sample.c

  • Committer: Bazaar Package Importer
  • Author(s): Noèl Köthe
  • Date: 2009-07-28 10:17:23 UTC
  • mto: (2.1.4 squeeze) (1.1.6 upstream)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20090728101723-t19vhrbss6yz5v8u
Import upstream version 2.0.16

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
        case IPMI_FRU_DATA_BINARY:
215
215
            printf("(binary)");
216
216
            for (j=0; j<data_len; j++)
217
 
                printf(" %2.2x", data[i]);
 
217
                printf(" %2.2x", data[j]);
218
218
            printf("\n");
219
219
            break;
220
220
 
221
221
        case IPMI_FRU_DATA_UNICODE:
222
222
            printf("(unicode)");
223
223
            for (j=0; j<data_len; j++)
224
 
                printf(" %2.2x", data[i]);
 
224
                printf(" %2.2x", data[j]);
225
225
            printf("\n");
226
226
            break;
227
227
 
418
418
    /* Override the default log handler (just to show how). */
419
419
    os_hnd->set_log_handler(os_hnd, my_vlog);
420
420
 
421
 
    /* Initialize the OpenIPMI library. */
422
 
    ipmi_init(os_hnd);
 
421
    /* Initialize the OpenIPMI library.  Do a double one to look for
 
422
       init/shutdown bugs. */
 
423
    rv = ipmi_init(os_hnd);
 
424
    if (rv) {
 
425
        fprintf(stderr, "Error in ipmi initialization %d: %s\n",
 
426
                curr_arg, strerror(rv));
 
427
        exit(1);
 
428
    }
 
429
    ipmi_shutdown();
 
430
    rv = ipmi_init(os_hnd);
 
431
    if (rv) {
 
432
        fprintf(stderr, "Error in ipmi initialization(2) %d: %s\n",
 
433
                curr_arg, strerror(rv));
 
434
        exit(1);
 
435
    }
423
436
 
424
437
#if 0
425
438
    /* If all you need is an SMI connection, this is all the code you