Changeset dd8ab1c in mainline


Ignore:
Timestamp:
2017-12-10T21:08:11Z (6 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:
68e5406
Parents:
1afa94d
Message:

More str_error() additions.

Location:
uspace
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/cp/cp.c

    r1afa94d rdd8ab1c  
    2828
    2929#include <errno.h>
     30#include <str_error.h>
    3031#include <stdio.h>
    3132#include <stdlib.h>
     
    432433
    433434        if (rc != EOK) {
    434                 printf("\nError copying %s, (%d)\n", src, rc);
     435                printf("\nError copying %s: %s\n", src, str_error(rc));
    435436                return rc;
    436437        }
  • uspace/app/bdsh/cmds/modules/ls/ls.c

    r1afa94d rdd8ab1c  
    3232
    3333#include <errno.h>
     34#include <str_error.h>
    3435#include <stdio.h>
    3536#include <stdlib.h>
     
    184185                if (rc != EOK) {
    185186                        printf("ls: skipping bogus node %s\n", buff);
    186                         printf("error=%d\n", rc);
     187                        printf("error=%s\n", str_error_name(rc));
    187188                        goto out;
    188189                }
  • uspace/app/bdsh/cmds/modules/mv/mv.c

    r1afa94d rdd8ab1c  
    3030#include <stdlib.h>
    3131#include <errno.h>
     32#include <str_error.h>
    3233#include <vfs/vfs.h>
    3334#include "config.h"
     
    6263        rc = vfs_rename_path(argv[1], argv[2]);
    6364        if (rc != EOK) {
    64                 printf("Unable to rename %s to %s (error=%d)\n",
    65                     argv[1], argv[2], rc);
     65                printf("Unable to rename %s to %s: %s)\n",
     66                    argv[1], argv[2], str_error(rc));
    6667                return CMD_FAILURE;
    6768        }
  • uspace/app/bdsh/cmds/modules/unmount/unmount.c

    r1afa94d rdd8ab1c  
    3131#include <vfs/vfs.h>
    3232#include <errno.h>
     33#include <str_error.h>
    3334#include "config.h"
    3435#include "util.h"
     
    6869        rc = vfs_unmount_path(argv[1]);
    6970        if (rc != EOK) {
    70                 printf("Unable to unmount %s (rc=%d)\n", argv[1], rc);
     71                printf("Unable to unmount %s: %s\n", argv[1], str_error(rc));
    7172                return CMD_FAILURE;
    7273        }
  • uspace/drv/audio/hdaudio/codec.c

    r1afa94d rdd8ab1c  
    3737#include <ddf/log.h>
    3838#include <errno.h>
     39#include <str_error.h>
    3940#include <stdlib.h>
    4041
     
    514515                goto error;
    515516
    516         ddf_msg(LVL_NOTE, "hda_get_subnc -> %d", rc);
     517        ddf_msg(LVL_NOTE, "hda_get_subnc -> %s", str_error_name(rc));
    517518        ddf_msg(LVL_NOTE, "sfg=%d nfg=%d", sfg, nfg);
    518519
     
    524525                        goto error;
    525526
    526                 ddf_msg(LVL_NOTE, "hda_get_fgrp_type -> %d", rc);
     527                ddf_msg(LVL_NOTE, "hda_get_fgrp_type -> %s", str_error_name(rc));
    527528                ddf_msg(LVL_NOTE, "unsol: %d, grptype: %d", unsol, grptype);
    528529
     
    546547                        goto error;
    547548
    548                 ddf_msg(LVL_NOTE, "hda_get_subnc -> %d", rc);
     549                ddf_msg(LVL_NOTE, "hda_get_subnc -> %s", str_error_name(rc));
    549550                ddf_msg(LVL_NOTE, "saw=%d baw=%d", saw, naw);
    550551
  • uspace/drv/audio/hdaudio/hdaudio.c

    r1afa94d rdd8ab1c  
    267267            hdaudio_interrupt, &irq_code, &irq_cap);
    268268        if (rc != EOK) {
    269                 ddf_msg(LVL_ERROR, "Failed registering interrupt handler. (%d)",
    270                     rc);
     269                ddf_msg(LVL_ERROR, "Failed registering interrupt handler: %s",
     270                    str_error_name(rc));
    271271                goto error;
    272272        }
     
    314314        hw_res_list_parsed_clean(&res);
    315315
    316         ddf_msg(LVL_NOTE, "Failing hda_dev_add() -> %d", rc);
     316        ddf_msg(LVL_NOTE, "Failing hda_dev_add() -> %s", str_error_name(rc));
    317317        return rc;
    318318}
  • uspace/drv/audio/hdaudio/stream.c

    r1afa94d rdd8ab1c  
    3939#include <ddi.h>
    4040#include <errno.h>
     41#include <str_error.h>
    4142#include <macros.h>
    4243#include <stdlib.h>
     
    122123            0, &buffer_phys, &buffer);
    123124        if (rc != EOK) {
    124                 ddf_msg(LVL_NOTE, "dmamem_map_anon -> %d", rc);
     125                ddf_msg(LVL_NOTE, "dmamem_map_anon -> %s", str_error_name(rc));
    125126                goto error;
    126127        }
  • uspace/drv/char/ns8250/ns8250.c

    r1afa94d rdd8ab1c  
    4040#include <stdio.h>
    4141#include <errno.h>
     42#include <str_error.h>
    4243#include <stdbool.h>
    4344#include <fibril_synch.h>
     
    887888        if (rc != EOK) {
    888889                ddf_msg(LVL_ERROR, "Failed to enable the interrupt. Error code = "
    889                     "%d.", rc);
     890                    "%s.", str_error_name(rc));
    890891                goto fail;
    891892        }
  • uspace/drv/char/pl050/pl050.c

    r1afa94d rdd8ab1c  
    217217            res.irqs.irqs[0], pl050_interrupt, &pl050_irq_code, &irq_cap);
    218218        if (rc != EOK) {
    219                 ddf_msg(LVL_ERROR, "Failed registering interrupt handler. (%d)",
    220                     rc);
     219                ddf_msg(LVL_ERROR, "Failed registering interrupt handler. (%s)",
     220                    str_error_name(rc));
    221221                goto error;
    222222        }
  • uspace/drv/char/sun4v-con/sun4v-con.c

    r1afa94d rdd8ab1c  
    3636#include <ddi.h>
    3737#include <errno.h>
     38#include <str_error.h>
    3839#include <io/chardev_srv.h>
    3940#include <stdbool.h>
     
    9293            (void *) &con->input_buffer);
    9394        if (rc != EOK) {
    94                 ddf_msg(LVL_ERROR, "Error mapping memory: %d", rc);
     95                ddf_msg(LVL_ERROR, "Error mapping memory: %s", str_error_name(rc));
    9596                goto error;
    9697        }
     
    101102            (void *) &con->output_buffer);
    102103        if (rc != EOK) {
    103                 ddf_msg(LVL_ERROR, "Error mapping memory: %d", rc);
     104                ddf_msg(LVL_ERROR, "Error mapping memory: %s", str_error_name(rc));
    104105                return rc;
    105106        }
  • uspace/drv/hid/ps2mouse/ps2mouse.c

    r1afa94d rdd8ab1c  
    3636#include <stdbool.h>
    3737#include <errno.h>
     38#include <str_error.h>
    3839#include <ddf/log.h>
    3940#include <io/keycode.h>
     
    7879        const int rc = chardev_read((mouse)->chardev, &data, 1, &nread); \
    7980        if (rc != EOK) { \
    80                 ddf_msg(LVL_ERROR, "Failed reading byte: %d", rc);\
     81                ddf_msg(LVL_ERROR, "Failed reading byte: %s", str_error_name(rc));\
    8182                return rc; \
    8283        } \
     
    9596        const int rc = chardev_write((mouse)->chardev, &data, 1, &nwr); \
    9697        if (rc != EOK) { \
    97                 ddf_msg(LVL_ERROR, "Failed writing byte: %d", rc); \
     98                ddf_msg(LVL_ERROR, "Failed writing byte: %s", str_error_name(rc)); \
    9899                return rc; \
    99100        } \
  • uspace/drv/intctl/apic/apic.c

    r1afa94d rdd8ab1c  
    221221        rc = pio_enable((void *) res->base, IO_APIC_SIZE, &regs);
    222222        if (rc != EOK) {
    223                 printf("%s: Failed to enable PIO for APIC: %d\n", NAME, rc);
     223                printf("%s: Failed to enable PIO for APIC: %s\n", NAME, str_error(rc));
    224224                return EIO;
    225225        }
  • uspace/drv/nic/ar9271/ar9271.c

    r1afa94d rdd8ab1c  
    4242#include <ddf/interrupt.h>
    4343#include <errno.h>
     44#include <str_error.h>
    4445#include <nic.h>
    4546#include <macros.h>
     
    784785                        free(buffer);
    785786                        usb_log_error("Error while uploading firmware. "
    786                             "Error: %d\n", rc);
     787                            "Error: %s\n", str_error_name(rc));
    787788                        return rc;
    788789                }
     
    836837        if (rc != EOK) {
    837838                usb_log_error("Failed to create USB device: %s, "
    838                     "ERR_NUM = %d\n", err_msg, rc);
     839                    "ERR_NUM = %s\n", err_msg, str_error_name(rc));
    839840                return NULL;
    840841        }
     
    853854        if (rc != EOK) {
    854855                free(ar9271);
    855                 usb_log_error("Failed to initialize AR9271 structure: %d\n",
    856                     rc);
     856                usb_log_error("Failed to initialize AR9271 structure: %s\n",
     857                    str_error_name(rc));
    857858                return NULL;
    858859        }
  • uspace/drv/nic/ar9271/htc.c

    r1afa94d rdd8ab1c  
    3636#include <byteorder.h>
    3737#include <errno.h>
     38#include <str_error.h>
    3839#include "wmi.h"
    3940#include "htc.h"
     
    264265        if (rc != EOK) {
    265266                free(buffer);
    266                 usb_log_error("Failed to send HTC message. Error: %d\n", rc);
     267                usb_log_error("Failed to send HTC message. Error: %s\n", str_error_name(rc));
    267268                return rc;
    268269        }
     
    278279                free(buffer);
    279280                usb_log_error("Failed to receive HTC service connect response. "
    280                     "Error: %d\n", rc);
     281                    "Error: %s\n", str_error_name(rc));
    281282                return rc;
    282283        }
     
    331332                free(buffer);
    332333                usb_log_error("Failed to send HTC config message. "
    333                     "Error: %d\n", rc);
     334                    "Error: %s\n", str_error_name(rc));
    334335                return rc;
    335336        }
     
    344345        if (rc != EOK) {
    345346                usb_log_error("Failed to receive HTC config response message. "
    346                     "Error: %d\n", rc);
     347                    "Error: %s\n", str_error_name(rc));
    347348        }
    348349       
     
    376377        if (rc != EOK)
    377378                usb_log_error("Failed to send HTC setup complete message. "
    378                     "Error: %d\n", rc);
     379                    "Error: %s\n", str_error_name(rc));
    379380       
    380381        free(buffer);
     
    404405                free(buffer);
    405406                usb_log_error("Failed to receive HTC check ready message. "
    406                     "Error: %d\n", rc);
     407                    "Error: %s\n", str_error_name(rc));
    407408                return rc;
    408409        }
  • uspace/drv/nic/ar9271/wmi.c

    r1afa94d rdd8ab1c  
    3535#include <usb/debug.h>
    3636#include <errno.h>
     37#include <str_error.h>
    3738#include <stdlib.h>
    3839#include <mem.h>
     
    245246        if (rc != EOK) {
    246247                free(buffer);
    247                 usb_log_error("Failed to send WMI message. Error: %d\n", rc);
     248                usb_log_error("Failed to send WMI message. Error: %s\n", str_error_name(rc));
    248249                return rc;
    249250        }
     
    268269                        free(buffer);
    269270                        usb_log_error("Failed to receive WMI message response. "
    270                             "Error: %d\n", rc);
     271                            "Error: %s\n", str_error_name(rc));
    271272                        return rc;
    272273                }
  • uspace/drv/nic/rtl8169/driver.c

    r1afa94d rdd8ab1c  
    3030#include <async.h>
    3131#include <errno.h>
     32#include <str_error.h>
    3233#include <align.h>
    3334#include <byteorder.h>
     
    430431        rc = rtl8169_register_int_handler(nic_data, &irq_cap);
    431432        if (rc != EOK) {
    432                 ddf_msg(LVL_ERROR, "Failed to register IRQ handler (%d)", rc);
     433                ddf_msg(LVL_ERROR, "Failed to register IRQ handler (%s)", str_error_name(rc));
    433434                goto err_irq;
    434435        }
     
    706707        rc = rtl8169_allocate_buffers(rtl8169);
    707708        if (rc != EOK) {
    708                 ddf_msg(LVL_ERROR, "Error allocating buffers: %d", rc);
     709                ddf_msg(LVL_ERROR, "Error allocating buffers: %s", str_error_name(rc));
    709710                return 0;
    710711        }
  • uspace/srv/hid/input/input.c

    r1afa94d rdd8ab1c  
    827827        int rc = loc_register_cat_change_cb(cat_change_cb);
    828828        if (rc != EOK) {
    829                 printf("%s: Failed registering callback for device discovery. "
    830                     "(%d)\n", NAME, rc);
     829                printf("%s: Failed registering callback for device discovery: "
     830                    "%s\n", NAME, str_error(rc));
    831831                return rc;
    832832        }
  • uspace/srv/hid/rfb/rfb.c

    r1afa94d rdd8ab1c  
    601601        int rc = tcp_conn_send(conn, "RFB 003.008\n", 12);
    602602        if (rc != EOK) {
    603                 log_msg(LOG_DEFAULT, LVL_WARN, "Failed sending server version %d", rc);
     603                log_msg(LOG_DEFAULT, LVL_WARN, "Failed sending server version: %s",
     604                    str_error(rc));
    604605                return;
    605606        }
     
    608609        rc = recv_chars(conn, client_version, 12);
    609610        if (rc != EOK) {
    610                 log_msg(LOG_DEFAULT, LVL_WARN, "Failed receiving client version: %d", rc);
     611                log_msg(LOG_DEFAULT, LVL_WARN, "Failed receiving client version: %s",
     612                    str_error(rc));
    611613                return;
    612614        }
     
    626628        if (rc != EOK) {
    627629                log_msg(LOG_DEFAULT, LVL_WARN,
    628                     "Failed sending security handshake: %d", rc);
     630                    "Failed sending security handshake: %s", str_error(rc));
    629631                return;
    630632        }
     
    633635        rc = recv_char(conn, &selected_sec_type);
    634636        if (rc != EOK) {
    635                 log_msg(LOG_DEFAULT, LVL_WARN, "Failed receiving security type: %d", rc);
     637                log_msg(LOG_DEFAULT, LVL_WARN, "Failed receiving security type: %s",
     638                    str_error(rc));
    636639                return;
    637640        }
     
    644647        rc = tcp_conn_send(conn, &security_result, sizeof(uint32_t));
    645648        if (rc != EOK) {
    646                 log_msg(LOG_DEFAULT, LVL_WARN, "Failed sending security result: %d", rc);
     649                log_msg(LOG_DEFAULT, LVL_WARN, "Failed sending security result: %s",
     650                    str_error(rc));
    647651                return;
    648652        }
     
    652656        rc = recv_char(conn, &shared_flag);
    653657        if (rc != EOK) {
    654                 log_msg(LOG_DEFAULT, LVL_WARN, "Failed receiving client init: %d", rc);
     658                log_msg(LOG_DEFAULT, LVL_WARN, "Failed receiving client init: %s",
     659                    str_error(rc));
    655660                return;
    656661        }
     
    675680        rc = tcp_conn_send(conn, server_init, msg_length);
    676681        if (rc != EOK) {
    677                 log_msg(LOG_DEFAULT, LVL_WARN, "Failed sending server init: %d", rc);
     682                log_msg(LOG_DEFAULT, LVL_WARN, "Failed sending server init: %s",
     683                    str_error(rc));
    678684                return;
    679685        }
  • uspace/srv/volsrv/part.c

    r1afa94d rdd8ab1c  
    329329        rc = volsrv_part_empty(part->svc_id);
    330330        if (rc != EOK) {
    331                 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_empty_part() - failed %d",
    332                     rc);
     331                log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_empty_part() - failed %s",
     332                    str_error(rc));
    333333                return rc;
    334334        }
     
    349349        rc = volsrv_part_mkfs(part->svc_id, fstype, label);
    350350        if (rc != EOK) {
    351                 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_mkfs_part() - failed %d",
    352                     rc);
     351                log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_mkfs_part() - failed %s",
     352                    str_error(rc));
    353353                fibril_mutex_unlock(&vol_parts_lock);
    354354                return rc;
Note: See TracChangeset for help on using the changeset viewer.