Changeset d5c1051 in mainline for uspace/app/taskdump/taskdump.c


Ignore:
Timestamp:
2017-12-20T22:25:34Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
39b54fe
Parents:
8610c2c
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-20 22:22:29)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-20 22:25:34)
Message:

"Obviously harmless" error handling tweaks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/taskdump/taskdump.c

    r8610c2c rd5c1051  
    9292
    9393        rc = connect_task(task_id);
    94         if (rc < 0) {
     94        if (rc != EOK) {
    9595                printf("Failed connecting to task %" PRIu64 ".\n", task_id);
    9696                return 1;
     
    105105
    106106        rc = threads_dump();
    107         if (rc < 0)
     107        if (rc != EOK)
    108108                printf("Failed dumping threads.\n");
    109109
    110110        rc = areas_dump();
    111         if (rc < 0)
     111        if (rc != EOK)
    112112                printf("Failed dumping address space areas.\n");
    113113
    114114        rc = fibrils_dump(app_symtab, sess);
    115         if (rc < 0)
     115        if (rc != EOK)
    116116                printf("Failed dumping fibrils.\n");
    117117
     
    141141       
    142142        int rc = udebug_begin(ksess);
    143         if (rc < 0) {
     143        if (rc != EOK) {
    144144                printf("udebug_begin() -> %s\n", str_error_name(rc));
    145145                return rc;
     
    223223        /* TODO: See why NULL does not work. */
    224224        rc = udebug_thread_read(sess, &dummy_buf, 0, &copied, &needed);
    225         if (rc < 0) {
     225        if (rc != EOK) {
    226226                printf("udebug_thread_read() -> %s\n", str_error_name(rc));
    227227                return rc;
     
    237237
    238238        rc = udebug_thread_read(sess, thash_buf, buf_size, &copied, &needed);
    239         if (rc < 0) {
     239        if (rc != EOK) {
    240240                printf("udebug_thread_read() -> %s\n", str_error_name(rc));
    241241                return rc;
     
    272272
    273273        rc = udebug_areas_read(sess, &dummy_buf, 0, &copied, &needed);
    274         if (rc < 0) {
     274        if (rc != EOK) {
    275275                printf("udebug_areas_read() -> %s\n", str_error_name(rc));
    276276                return rc;
     
    281281
    282282        rc = udebug_areas_read(sess, ainfo_buf, buf_size, &copied, &needed);
    283         if (rc < 0) {
     283        if (rc != EOK) {
    284284                printf("udebug_areas_read() -> %s\n", str_error_name(rc));
    285285                return rc;
     
    357357
    358358        rc = udebug_regs_read(sess, thash, &istate);
    359         if (rc < 0) {
     359        if (rc != EOK) {
    360360                printf("Failed reading registers: %s.\n", str_error_name(rc));
    361361                return EIO;
     
    386386
    387387        rc = udebug_mem_read(sess, &data, addr, sizeof(data));
    388         if (rc < 0) {
     388        if (rc != EOK) {
    389389                printf("Warning: udebug_mem_read() failed.\n");
    390390                return rc;
     
    400400        char *file_name;
    401401        int rc;
     402        int ret;
    402403
    403404        assert(app_name != NULL);
    404405        assert(app_symtab == NULL);
    405406
    406         rc = asprintf(&file_name, "/app/%s", app_name);
    407         if (rc < 0) {
     407        ret = asprintf(&file_name, "/app/%s", app_name);
     408        if (ret < 0) {
    408409                printf("Memory allocation failure.\n");
    409410                exit(1);
     
    419420        free(file_name);
    420421
    421         rc = asprintf(&file_name, "/srv/%s", app_name);
    422         if (rc < 0) {
     422        ret = asprintf(&file_name, "/srv/%s", app_name);
     423        if (ret < 0) {
    423424                printf("Memory allocation failure.\n");
    424425                exit(1);
     
    432433        }
    433434
    434         rc = asprintf(&file_name, "/drv/%s/%s", app_name, app_name);
    435         if (rc < 0) {
     435        ret = asprintf(&file_name, "/drv/%s/%s", app_name, app_name);
     436        if (ret < 0) {
    436437                printf("Memory allocation failure.\n");
    437438                exit(1);
     
    457458
    458459        rc = udebug_name_read(sess, &dummy_buf, 0, &copied, &needed);
    459         if (rc < 0)
     460        if (rc != EOK)
    460461                return NULL;
    461462
     
    463464        name = malloc(name_size + 1);
    464465        rc = udebug_name_read(sess, name, name_size, &copied, &needed);
    465         if (rc < 0) {
     466        if (rc != EOK) {
    466467                free(name);
    467468                return NULL;
     
    488489        size_t offs;
    489490        int rc;
     491        int ret;
    490492        char *str;
    491493
     
    497499
    498500        if (rc == EOK) {
    499                 rc = asprintf(&str, "%p (%s+%zu)", (void *) addr, name, offs);
     501                ret = asprintf(&str, "%p (%s+%zu)", (void *) addr, name, offs);
    500502        } else {
    501                 rc = asprintf(&str, "%p", (void *) addr);
    502         }
    503 
    504         if (rc < 0) {
     503                ret = asprintf(&str, "%p", (void *) addr);
     504        }
     505
     506        if (ret < 0) {
    505507                printf("Memory allocation error.\n");
    506508                exit(1);
Note: See TracChangeset for help on using the changeset viewer.