Changeset 84a1a54 in mainline


Ignore:
Timestamp:
2018-01-04T20:47:53Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
facacc71
Parents:
cde999a
Message:

Wrap returns of errno from main() with EXIT_RC().

Returns of error code from main() prevent type checking when errno_t
and int are considered incompatible. In order to avoid the philosophical
discussion of what should and shouldn't be returned for main(), we simply
wrap the error values and leave the answer to the question for future
generations to decide.

Location:
uspace
Files:
49 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/scli.c

    rcde999a r84a1a54  
    120120
    121121        cli_finit(&usr);
    122         return ret;
     122        return EXIT_RC(ret);
    123123}
  • uspace/app/corecfg/corecfg.c

    rcde999a r84a1a54  
    3636#include <errno.h>
    3737#include <stdio.h>
     38#include <stdlib.h>
    3839
    3940#define NAME "corecfg"
     
    7677                return corecfg_print();
    7778        else if (str_cmp(argv[1], "enable") == 0)
    78                 return corecfg_set_enable(true);
     79                return EXIT_RC(corecfg_set_enable(true));
    7980        else if (str_cmp(argv[1], "disable") == 0)
    80                 return corecfg_set_enable(false);
     81                return EXIT_RC(corecfg_set_enable(false));
    8182        else {
    8283                printf("%s: Unknown command '%s'.\n", NAME, argv[1]);
  • uspace/app/date/date.c

    rcde999a r84a1a54  
    191191        free(svc_name);
    192192        free(svc_ids);
    193         return rc;
     193        return EXIT_RC(rc);
    194194}
    195195
  • uspace/app/dnscfg/dnscfg.c

    rcde999a r84a1a54  
    128128{
    129129        if ((argc < 2) || (str_cmp(argv[1], "get-ns") == 0))
    130                 return dnscfg_print();
     130                return EXIT_RC(dnscfg_print());
    131131        else if (str_cmp(argv[1], "set-ns") == 0)
    132                 return dnscfg_set_ns(argc - 2, argv + 2);
     132                return EXIT_RC(dnscfg_set_ns(argc - 2, argv + 2));
    133133        else if (str_cmp(argv[1], "unset-ns") == 0)
    134                 return dnscfg_unset_ns();
     134                return EXIT_RC(dnscfg_unset_ns());
    135135        else {
    136136                printf("%s: Unknown command '%s'.\n", NAME, argv[1]);
  • uspace/app/dnsres/dnsres.c

    rcde999a r84a1a54  
    8181        if (rc != EOK) {
    8282                printf("%s: Error resolving '%s'.\n", NAME, hname);
    83                 return rc;
     83                return EXIT_RC(rc);
    8484        }
    8585       
     
    8989                dnsr_hostinfo_destroy(hinfo);
    9090                printf("%s: Error formatting address.\n", NAME);
    91                 return rc;
     91                return EXIT_RC(rc);
    9292        }
    9393       
  • uspace/app/download/main.c

    rcde999a r84a1a54  
    240240        if (ofile != NULL && fclose(ofile) != 0) {
    241241                printf("Error writing '%s'.\n", ofname);
    242                 return EIO;
    243         }
    244 
    245         return EOK;
     242                return EXIT_RC(EIO);
     243        }
     244
     245        return 0;
    246246error:
    247247        free(buf);
     
    252252        if (ofile != NULL)
    253253                fclose(ofile);
    254         return rc;
     254        return EXIT_RC(rc);
    255255}
    256256
  • uspace/app/getterm/getterm.c

    rcde999a r84a1a54  
    3737#include <stdint.h>
    3838#include <stdio.h>
     39#include <stdlib.h>
    3940#include <task.h>
    4041#include <str_error.h>
     
    137138                        printf("%s: Error waiting on %s (%s)\n", APP_NAME, term,
    138139                            str_error(rc));
    139                         return rc;
     140                        return EXIT_RC(rc);
    140141                }
    141142        }
     
    174175                printf("%s: Error spawning %s (%s)\n", APP_NAME, cmd,
    175176                    str_error(rc));
    176                 return rc;
     177                return EXIT_RC(rc);
    177178        }
    178179       
     
    183184                printf("%s: Error waiting for %s (%s)\n", APP_NAME, cmd,
    184185                    str_error(rc));
    185                 return rc;
     186                return EXIT_RC(rc);
    186187        }
    187188       
  • uspace/app/kio/kio.c

    rcde999a r84a1a54  
    191191                fprintf(stderr, "%s: Unable to get number of kio pages\n",
    192192                    NAME);
    193                 return rc;
     193                return EXIT_RC(rc);
    194194        }
    195195       
     
    199199                fprintf(stderr, "%s: Unable to get kio physical address\n",
    200200                    NAME);
    201                 return rc;
     201                return EXIT_RC(rc);
    202202        }
    203203       
     
    209209        if (rc != EOK) {
    210210                fprintf(stderr, "%s: Unable to map kio\n", NAME);
    211                 return rc;
     211                return EXIT_RC(rc);
    212212        }
    213213       
     
    217217                fprintf(stderr, "%s: Unable to register kio notifications\n",
    218218                    NAME);
    219                 return rc;
     219                return EXIT_RC(rc);
    220220        }
    221221       
     
    224224                fprintf(stderr, "%s: Unable to create consumer fibril\n",
    225225                    NAME);
    226                 return ENOMEM;
     226                return EXIT_RC(ENOMEM);
    227227        }
    228228       
     
    230230        if (!input) {
    231231                fprintf(stderr, "%s: Could not create input\n", NAME);
    232                 return ENOMEM;
     232                return EXIT_RC(ENOMEM);
    233233        }
    234234
     
    253253                rc = EOK;
    254254
    255         return EOK;
     255        return EXIT_RC(rc);
    256256}
    257257
  • uspace/app/mkbd/main.c

    rcde999a r84a1a54  
    222222                printf("Device not found or not of USB kind: %s.\n",
    223223                    str_error(rc));
    224                 return rc;
     224                return EXIT_RC(rc);
    225225        }
    226226       
     
    229229                printf(NAME ": failed to connect to the device (handle %"
    230230                       PRIun "): %s.\n", dev_handle, str_error(errno));
    231                 return errno;
     231                return EXIT_RC(errno);
    232232        }
    233233       
     
    239239                printf(NAME ": failed to get path (handle %"
    240240                       PRIun "): %s.\n", dev_handle, str_error(errno));
    241                 return ENOMEM;
     241                return EXIT_RC(ENOMEM);
    242242        }
    243243       
     
    250250                printf("Failed to initialize report parser: %s\n",
    251251                    str_error(rc));
    252                 return rc;
     252                return EXIT_RC(rc);
    253253        }
    254254       
     
    259259        if (rc != EOK) {
    260260                printf("Failed to get event length: %s.\n", str_error(rc));
    261                 return rc;
     261                return EXIT_RC(rc);
    262262        }
    263263       
     
    266266                printf("Out of memory.\n");
    267267                // TODO: hangup phone?
    268                 return ENOMEM;
     268                return EXIT_RC(ENOMEM);
    269269        }
    270270       
  • uspace/app/nic/nic.c

    rcde999a r84a1a54  
    413413        async_sess_t *sess;
    414414        nic_address_t addr;
    415         int rc, idx;
     415        int rc;
     416        int idx;
    416417
    417418        sess = get_nic_by_index(i);
     
    543544
    544545                if (!str_cmp(argv[2], "addr"))
    545                         return nic_set_addr(index, argv[3]);
     546                        return EXIT_RC(nic_set_addr(index, argv[3]));
    546547
    547548                if (!str_cmp(argv[2], "speed"))
    548                         return nic_set_speed(index, argv[3]);
     549                        return EXIT_RC(nic_set_speed(index, argv[3]));
    549550
    550551                if (!str_cmp(argv[2], "duplex"))
    551                         return nic_set_duplex(index, argv[3]);
     552                        return EXIT_RC(nic_set_duplex(index, argv[3]));
    552553
    553554                if (!str_cmp(argv[2], "auto"))
    554                         return nic_set_autoneg(index);
     555                        return EXIT_RC(nic_set_autoneg(index));
    555556
    556557                if (!str_cmp(argv[2], "unicast"))
    557                         return nic_set_rx_unicast(index, argv[3]);
     558                        return EXIT_RC(nic_set_rx_unicast(index, argv[3]));
    558559
    559560                if (!str_cmp(argv[2], "multicast"))
    560                         return nic_set_rx_multicast(index, argv[3]);
     561                        return EXIT_RC(nic_set_rx_multicast(index, argv[3]));
    561562
    562563                if (!str_cmp(argv[2], "broadcast"))
    563                         return nic_set_rx_broadcast(index, argv[3]);
     564                        return EXIT_RC(nic_set_rx_broadcast(index, argv[3]));
    564565
    565566        } else {
  • uspace/app/sysinfo/sysinfo.c

    rcde999a r84a1a54  
    9090        fputs("')\n", stdout);
    9191       
    92         return EOK;
     92        return 0;
    9393}
    9494
     
    109109        fputs("')\n", stdout);
    110110       
    111         return EOK;
     111        return 0;
    112112}
    113113
     
    182182                        break;
    183183                case SYSINFO_VAL_VAL:
    184                         rc = print_item_val(ipath);
     184                        rc = EXIT_RC(print_item_val(ipath));
    185185                        break;
    186186                case SYSINFO_VAL_DATA:
  • uspace/app/sysinst/sysinst.c

    rcde999a r84a1a54  
    387387{
    388388        const char *dev = DEFAULT_DEV;
    389         return sysinst_install(dev);
     389        return EXIT_RC(sysinst_install(dev));
    390390}
    391391
  • uspace/app/vuhid/main.c

    rcde999a r84a1a54  
    238238                printf("Unable to start communication with VHCD `%s': %s.\n",
    239239                    controller, str_error(rc));
    240                 return rc;
     240                return EXIT_RC(rc);
    241241        }
    242242       
  • uspace/app/websrv/websrv.c

    rcde999a r84a1a54  
    450450                        rc = parse_option(argc, argv, &i);
    451451                        if (rc != EOK)
    452                                 return rc;
     452                                return EXIT_RC(rc);
    453453                } else {
    454454                        usage();
    455                         return EINVAL;
     455                        return EXIT_RC(EINVAL);
    456456                }
    457457        }
  • uspace/app/wifi_supplicant/wifi_supplicant.c

    rcde999a r84a1a54  
    293293        if (argc == 2) {
    294294                if (!str_cmp(argv[1], "list"))
    295                         return wifi_list();
     295                        return EXIT_RC(wifi_list());
    296296        } else if (argc > 2) {
    297297                uint32_t index;
     
    300300                        printf("%s: Invalid argument.\n", NAME);
    301301                        print_syntax();
    302                         return EINVAL;
     302                        return EXIT_RC(EINVAL);
    303303                }
    304304               
     
    309309                                        now = true;
    310310                       
    311                         return wifi_scan(index, now);
     311                        return EXIT_RC(wifi_scan(index, now));
    312312                } else if (!str_cmp(argv[1], "connect")) {
    313313                        char *pass = NULL;
     
    316316                                        pass = argv[4];
    317317                               
    318                                 return wifi_connect(index, argv[3], pass);
     318                                return EXIT_RC(wifi_connect(index, argv[3], pass));
    319319                        }
    320320                } else if (!str_cmp(argv[1], "disconnect"))
    321                         return wifi_disconnect(index);
     321                        return EXIT_RC(wifi_disconnect(index));
    322322        }
    323323       
    324324        print_syntax();
    325325       
    326         return EOK;
     326        return 0;
    327327}
    328328
  • uspace/drv/nic/rtl8139/driver.c

    rcde999a r84a1a54  
    21452145        int rc = nic_driver_init(NAME);
    21462146        if (rc != EOK)
    2147                 return rc;
     2147                return EXIT_RC(rc);
    21482148
    21492149        nic_driver_implement(&rtl8139_driver_ops, &rtl8139_dev_ops,
  • uspace/drv/nic/rtl8169/driver.c

    rcde999a r84a1a54  
    12101210        int rc = nic_driver_init(NAME);
    12111211        if (rc != EOK)
    1212                 return rc;
     1212                return EXIT_RC(rc);
    12131213        nic_driver_implement(
    12141214                &rtl8169_driver_ops, &rtl8169_dev_ops, &rtl8169_nic_iface);
  • uspace/lib/c/include/stdlib.h

    rcde999a r84a1a54  
    5151extern void exit(int) __attribute__((noreturn));
    5252
     53#define EXIT_SUCCESS 0
     54#define EXIT_FAILURE -1
     55
     56#include <errno.h>
     57static inline int EXIT_RC(errno_t rc) {
     58        return (int) rc;
     59}
     60
    5361#endif
    5462
  • uspace/lib/drv/generic/driver.c

    rcde999a r84a1a54  
    978978        if (rc != EOK) {
    979979                printf("Error: Failed to create driver port.\n");
    980                 return rc;
     980                return EXIT_RC(rc);
    981981        }
    982982       
     
    985985        if (rc != EOK) {
    986986                printf("Error: Failed to create devman port.\n");
    987                 return rc;
     987                return EXIT_RC(rc);
    988988        }
    989989       
     
    996996                    str_error(rc));
    997997               
    998                 return rc;
     998                return EXIT_RC(rc);
    999999        }
    10001000       
     
    10031003        if (rc != EOK) {
    10041004                printf("Error: Failed returning task value.\n");
    1005                 return rc;
     1005                return EXIT_RC(rc);
    10061006        }
    10071007       
     
    10091009       
    10101010        /* Never reached. */
    1011         return EOK;
     1011        return 0;
    10121012}
    10131013
  • uspace/srv/audio/hound/main.c

    rcde999a r84a1a54  
    8080                log_fatal("Failed to initialize hound structure: %s",
    8181                    str_error(ret));
    82                 return -ret;
     82                return EXIT_RC(ret);
    8383        }
    8484
     
    9191        if (ret != EOK) {
    9292                log_fatal("Failed to register server: %s", str_error(ret));
    93                 return -ret;
     93                return EXIT_RC(ret);
    9494        }
    9595
     
    9999                    str_error(ret));
    100100                hound_server_unregister(id);
    101                 return -ret;
     101                return EXIT_RC(ret);
    102102        }
    103103        log_info("Running with service id %" PRIun, id);
  • uspace/srv/bd/file_bd/file_bd.c

    rcde999a r84a1a54  
    4747#include <stddef.h>
    4848#include <stdint.h>
     49#include <stdlib.h>
    4950#include <errno.h>
    5051#include <str_error.h>
     
    137138                printf("%s: Unable to register device '%s': %s.\n",
    138139                    NAME, device_name, str_error(rc));
    139                 return rc;
     140                return EXIT_RC(rc);
    140141        }
    141142
     
    143144        if (rc != EOK) {
    144145                printf("%s: Failed resolving category 'disk': %s\n", NAME, str_error(rc));
    145                 return rc;
     146                return EXIT_RC(rc);
    146147        }
    147148
     
    150151                printf("%s: Failed adding %s to category: %s",
    151152                    NAME, device_name, str_error(rc));
    152                 return rc;
     153                return EXIT_RC(rc);
    153154        }
    154155
  • uspace/srv/bd/sata_bd/sata_bd.c

    rcde999a r84a1a54  
    253253        if (rc != EOK) {
    254254                printf(NAME ": Unable to register driver: %s.\n", str_error(rc));
    255                 return rc;
     255                return EXIT_RC(rc);
    256256        }
    257257       
    258258        rc = get_sata_disks();
    259259        if (rc != EOK) {
    260                 // TODO: log the error
    261                 return rc;
     260                printf(NAME ": Cannot find SATA disks: %s.\n", str_error(rc));
     261                return EXIT_RC(rc);
    262262        }
    263263
     
    265265        if (rc != EOK) {
    266266                printf("%s: Failed resolving category 'disk': %s.\n", NAME, str_error(rc));
    267                 return rc;
     267                return EXIT_RC(rc);
    268268        }
    269269
     
    274274                if (rc != EOK) {
    275275                        printf(NAME ": Unable to register device %s: %s\n", name, str_error(rc));
    276                         return rc;
     276                        return EXIT_RC(rc);
    277277                }
    278278
     
    281281                        printf("%s: Failed adding %s to category: %s.",
    282282                            NAME, disk[i].dev_name, str_error(rc));
    283                         return rc;
     283                        return EXIT_RC(rc);
    284284                }
    285285        }
  • uspace/srv/clipboard/clipboard.c

    rcde999a r84a1a54  
    190190        if (rc != EOK) {
    191191                printf("%s: Failed registering server: %s\n", NAME, str_error(rc));
    192                 return rc;
     192                return EXIT_RC(rc);
    193193        }
    194194       
     
    196196        if (rc != EOK) {
    197197                printf("%s: Failed registering service : %s\n", NAME, str_error(rc));
    198                 return rc;
     198                return EXIT_RC(rc);
    199199        }
    200200       
  • uspace/srv/devman/main.c

    rcde999a r84a1a54  
    320320        if (rc != EOK) {
    321321                printf("%s: Error initializing logging subsystem: %s\n", NAME, str_error(rc));
    322                 return rc;
     322                return EXIT_RC(rc);
    323323        }
    324324       
     
    332332        if (rc != EOK) {
    333333                printf("%s: Error creating DDF driver port: %s\n", NAME, str_error(rc));
    334                 return rc;
     334                return EXIT_RC(rc);
    335335        }
    336336       
     
    339339        if (rc != EOK) {
    340340                printf("%s: Error creating DDF client port: %s\n", NAME, str_error(rc));
    341                 return rc;
     341                return EXIT_RC(rc);
    342342        }
    343343       
     
    346346        if (rc != EOK) {
    347347                printf("%s: Error creating devman device port: %s\n", NAME, str_error(rc));
    348                 return rc;
     348                return EXIT_RC(rc);
    349349        }
    350350       
     
    353353        if (rc != EOK) {
    354354                printf("%s: Error creating devman parent port: %s\n", NAME, str_error(rc));
    355                 return rc;
     355                return EXIT_RC(rc);
    356356        }
    357357       
     
    367367        if (rc != EOK) {
    368368                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering as a service: %s", str_error(rc));
    369                 return rc;
     369                return EXIT_RC(rc);
    370370        }
    371371       
  • uspace/srv/fs/cdfs/cdfs.c

    rcde999a r84a1a54  
    4343#include <str_error.h>
    4444#include <stdio.h>
     45#include <stdlib.h>
    4546#include <libfs.h>
    4647#include "cdfs.h"
     
    8586        if (rc != EOK) {
    8687                printf("%s: Failed to register file system: %s\n", NAME, str_error(rc));
    87                 return rc;
     88                return EXIT_RC(rc);
    8889        }
    8990       
  • uspace/srv/fs/exfat/exfat.c

    rcde999a r84a1a54  
    4646#include <task.h>
    4747#include <stdio.h>
     48#include <stdlib.h>
    4849#include <libfs.h>
    4950#include "../../vfs/vfs.h"
     
    9798err:
    9899        printf(NAME ": Failed to register file system: %s\n", str_error(rc));
    99         return rc;
     100        return EXIT_RC(rc);
    100101}
    101102
  • uspace/srv/fs/ext4fs/ext4fs.c

    rcde999a r84a1a54  
    4040#include <ns.h>
    4141#include <stdio.h>
     42#include <stdlib.h>
    4243#include <task.h>
    4344#include <ipc/services.h>
     
    7576        if (rc != EOK) {
    7677                printf("%s: Global initialization failed\n", NAME);
    77                 return rc;
     78                return EXIT_RC(rc);
    7879        }
    7980       
     
    8283        if (rc != EOK) {
    8384                printf("%s: Failed to register file system\n", NAME);
    84                 return rc;
     85                return EXIT_RC(rc);
    8586        }
    8687       
  • uspace/srv/fs/fat/fat.c

    rcde999a r84a1a54  
    4646#include <task.h>
    4747#include <stdio.h>
     48#include <stdlib.h>
    4849#include <libfs.h>
    4950#include "../../vfs/vfs.h"
     
    9798err:
    9899        printf(NAME ": Failed to register file system: %s\n", str_error(rc));
    99         return rc;
     100        return EXIT_RC(rc);
    100101}
    101102
  • uspace/srv/fs/locfs/locfs.c

    rcde999a r84a1a54  
    4040
    4141#include <stdio.h>
     42#include <stdlib.h>
    4243#include <ipc/services.h>
    4344#include <ns.h>
     
    8990        if (rc != EOK) {
    9091                printf("%s: Failed to register file system: %s\n", NAME, str_error(rc));
    91                 return rc;
     92                return EXIT_RC(rc);
    9293        }
    9394       
  • uspace/srv/fs/mfs/mfs.c

    rcde999a r84a1a54  
    100100err:
    101101        printf(NAME ": Failed to register file system: %s\n", str_error(rc));
    102         return rc;
     102        return EXIT_RC(rc);
    103103}
    104104
  • uspace/srv/fs/tmpfs/tmpfs.c

    rcde999a r84a1a54  
    4848#include <str_error.h>
    4949#include <stdio.h>
     50#include <stdlib.h>
    5051#include <task.h>
    5152#include <libfs.h>
     
    9192        if (rc != EOK) {
    9293                printf(NAME ": Failed to register file system: %s\n", str_error(rc));
    93                 return rc;
     94                return EXIT_RC(rc);
    9495        }
    9596       
  • uspace/srv/fs/udf/udf.c

    rcde999a r84a1a54  
    4242#include <errno.h>
    4343#include <str_error.h>
     44#include <stdlib.h>
    4445#include <task.h>
    4546#include <libfs.h>
     
    9899err:
    99100        log_msg(LOG_DEFAULT, LVL_FATAL, "Failed to register file system: %s", str_error(rc));
    100         return rc;
     101        return EXIT_RC(rc);
    101102}
    102103
  • uspace/srv/hid/compositor/compositor.c

    rcde999a r84a1a54  
    22542254        if (rc != EOK) {
    22552255                printf("%s: Unable to register server (%s)\n", NAME, str_error(rc));
    2256                 return -1;
     2256                return rc;
    22572257        }
    22582258       
     
    22722272        char winreg[LOC_NAME_MAXLEN + 1];
    22732273        snprintf(winreg, LOC_NAME_MAXLEN, "%s%s/winreg", NAMESPACE, server_name);
    2274         if (loc_service_register(winreg, &winreg_id) != EOK) {
     2274        rc = loc_service_register(winreg, &winreg_id);
     2275        if (rc != EOK) {
    22752276                printf("%s: Unable to register service %s\n", NAME, winreg);
    2276                 return -1;
     2277                return rc;
    22772278        }
    22782279       
     
    23152316        int rc = compositor_srv_init(argv[1], argv[2]);
    23162317        if (rc != EOK)
    2317                 return rc;
     2318                return EXIT_RC(rc);
    23182319       
    23192320        printf("%s: Accepting connections\n", NAME);
  • uspace/srv/hid/input/input.c

    rcde999a r84a1a54  
    869869        if (rc != EOK) {
    870870                printf("%s: Unable to register server\n", NAME);
    871                 return rc;
     871                return EXIT_RC(rc);
    872872        }
    873873       
     
    876876        if (rc != EOK) {
    877877                printf("%s: Unable to register service %s\n", NAME, argv[1]);
    878                 return rc;
     878                return EXIT_RC(rc);
    879879        }
    880880       
  • uspace/srv/hid/isdv4_tablet/main.c

    rcde999a r84a1a54  
    315315        if (rc != EOK) {
    316316                printf("%s: Unable to register driver.\n", NAME);
    317                 return rc;
     317                return EXIT_RC(rc);
    318318        }
    319319
    320320        service_id_t service_id;
    321321        char *service_name;
    322         rc = asprintf(&service_name, "mouse/isdv4-%" PRIun, svc_id);
    323         if (rc < 0) {
     322        if (asprintf(&service_name, "mouse/isdv4-%" PRIun, svc_id) < 0) {
    324323                printf(NAME ": Unable to create service name\n");
    325                 return rc;
     324                return EXIT_RC(ENOMEM);
    326325        }
    327326
     
    329328        if (rc != EOK) {
    330329                printf(NAME ": Unable to register service %s.\n", service_name);
    331                 return rc;
     330                return EXIT_RC(rc);
    332331        }
    333332
  • uspace/srv/hid/output/output.c

    rcde999a r84a1a54  
    470470        if (rc != EOK) {
    471471                printf("%s: Unable to register driver\n", NAME);
    472                 return rc;
     472                return EXIT_RC(rc);
    473473        }
    474474       
     
    477477        if (rc != EOK) {
    478478                printf("%s: Unable to register service %s\n", NAME, argv[1]);
    479                 return rc;
     479                return EXIT_RC(rc);
    480480        }
    481481       
  • uspace/srv/hid/remcons/remcons.c

    rcde999a r84a1a54  
    353353        if (rc != EOK) {
    354354                fprintf(stderr, "%s: Unable to register server\n", NAME);
    355                 return rc;
     355                return EXIT_RC(rc);
    356356        }
    357357
     
    359359        if (rc != EOK) {
    360360                fprintf(stderr, "%s: Error initializing TCP.\n", NAME);
    361                 return rc;
     361                return EXIT_RC(rc);
    362362        }
    363363
     
    369369        if (rc != EOK) {
    370370                fprintf(stderr, "%s: Error creating listener.\n", NAME);
    371                 return rc;
     371                return EXIT_RC(rc);
    372372        }
    373373
  • uspace/srv/hid/rfb/main.c

    rcde999a r84a1a54  
    220220        if (rc != EOK) {
    221221                printf("%s: Unable to register server.\n", NAME);
    222                 return rc;
     222                return EXIT_RC(rc);
    223223        }
    224224
    225225        char *service_name;
    226         rc = asprintf(&service_name, "rfb/%s", rfb_name);
    227         if (rc < 0) {
     226        if (asprintf(&service_name, "rfb/%s", rfb_name) < 0) {
    228227                printf(NAME ": Unable to create service name\n");
    229                 return rc;
     228                return EXIT_RC(ENOMEM);
    230229        }
    231230
     
    235234        if (rc != EOK) {
    236235                printf(NAME ": Unable to register service %s.\n", service_name);
    237                 return rc;
     236                return EXIT_RC(rc);
    238237        }
    239238       
  • uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c

    rcde999a r84a1a54  
    8888        if (rc != EOK) {
    8989                printf("%s: Unable to register driver.\n", NAME);
    90                 return rc;
     90                return EXIT_RC(rc);
    9191        }
    9292
     
    9595                return -1;
    9696
    97         if (s3c24xx_ts_init(ts) != EOK)
     97        if (s3c24xx_ts_init(ts) != 0)
    9898                return -1;
    9999
     
    141141        s3c24xx_ts_wait_for_int_mode(ts, updn_down);
    142142
    143         return EOK;
     143        return 0;
    144144}
    145145
  • uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c

    rcde999a r84a1a54  
    8585        if (rc != EOK) {
    8686                printf("%s: Unable to register server.\n", NAME);
    87                 return rc;
     87                return EXIT_RC(rc);
    8888        }
    8989
     
    9292                return -1;
    9393
    94         if (s3c24xx_uart_init(uart) != EOK)
     94        if (s3c24xx_uart_init(uart) != 0)
    9595                return -1;
    9696
     
    187187        uart->cds.sarg = uart;
    188188
    189         return EOK;
     189        return 0;
    190190}
    191191
  • uspace/srv/klog/klog.c

    rcde999a r84a1a54  
    213213        if (rc != EOK) {
    214214                fprintf(stderr, "%s: Unable to initialize log\n", NAME);
    215                 return rc;
     215                return EXIT_RC(rc);
    216216        }
    217217       
     
    232232                log_msg(LOG_DEFAULT, LVL_ERROR,
    233233                    "Unable to register klog notifications");
    234                 return rc;
     234                return EXIT_RC(rc);
    235235        }
    236236       
     
    239239                log_msg(LOG_DEFAULT, LVL_ERROR,
    240240                    "Unable to create consumer fibril");
    241                 return ENOMEM;
     241                return EXIT_RC(ENOMEM);
    242242        }
    243243       
  • uspace/srv/loader/main.c

    rcde999a r84a1a54  
    397397        int rc = ns_intro(id);
    398398        if (rc != EOK)
    399                 return rc;
     399                return EXIT_RC(rc);
    400400       
    401401        /* Create port */
     
    403403        rc = async_create_port(INTERFACE_LOADER, ldr_connection, NULL, &port);
    404404        if (rc != EOK)
    405                 return rc;
     405                return EXIT_RC(rc);
    406406       
    407407        /* Register at naming service. */
    408408        rc = service_register(SERVICE_LOADER);
    409409        if (rc != EOK)
    410                 return rc;
     410                return EXIT_RC(rc);
    411411       
    412412        async_manager();
  • uspace/srv/locsrv/locsrv.c

    rcde999a r84a1a54  
    15321532        if (rc != EOK) {
    15331533                printf("%s: Error while creating supplier port: %s\n", NAME, str_error(rc));
    1534                 return rc;
     1534                return EXIT_RC(rc);
    15351535        }
    15361536       
     
    15391539        if (rc != EOK) {
    15401540                printf("%s: Error while creating consumer port: %s\n", NAME, str_error(rc));
    1541                 return rc;
     1541                return EXIT_RC(rc);
    15421542        }
    15431543       
     
    15491549        if (rc != EOK) {
    15501550                printf("%s: Error while registering service: %s\n", NAME, str_error(rc));
    1551                 return rc;
     1551                return EXIT_RC(rc);
    15521552        }
    15531553       
  • uspace/srv/logger/main.c

    rcde999a r84a1a54  
    7474        if (rc != EOK) {
    7575                printf("%s: Error while creating control port: %s\n", NAME, str_error(rc));
    76                 return rc;
     76                return EXIT_RC(rc);
    7777        }
    7878       
     
    8181        if (rc != EOK) {
    8282                printf("%s: Error while creating writer port: %s\n", NAME, str_error(rc));
    83                 return rc;
     83                return EXIT_RC(rc);
    8484        }
    8585       
  • uspace/srv/net/loopip/loopip.c

    rcde999a r84a1a54  
    253253        if (rc != EOK) {
    254254                printf("%s: Failed to initialize logging: %s.\n", NAME, str_error(rc));
    255                 return rc;
     255                return EXIT_RC(rc);
    256256        }
    257257       
     
    259259        if (rc != EOK) {
    260260                printf("%s: Failed to initialize loopip: %s.\n", NAME, str_error(rc));
    261                 return rc;
     261                return EXIT_RC(rc);
    262262        }
    263263       
  • uspace/srv/net/slip/slip.c

    rcde999a r84a1a54  
    421421        if (argc != 3) {
    422422                usage();
    423                 return EINVAL;
     423                return EXIT_RC(EINVAL);
    424424        }
    425425
     
    427427        if (rc != EOK) {
    428428                printf(NAME ": failed to initialize log\n");
    429                 return rc;
     429                return EXIT_RC(rc);
    430430        }
    431431
  • uspace/srv/ns/ns.c

    rcde999a r84a1a54  
    4242#include <abi/ipc/interfaces.h>
    4343#include <stdio.h>
     44#include <stdlib.h>
    4445#include <errno.h>
    4546#include <macros.h>
     
    133134        int rc = service_init();
    134135        if (rc != EOK)
    135                 return rc;
     136                return EXIT_RC(rc);
    136137       
    137138        rc = clonable_init();
    138139        if (rc != EOK)
    139                 return rc;
     140                return EXIT_RC(rc);
    140141       
    141142        rc = task_init();
    142143        if (rc != EOK)
    143                 return rc;
     144                return EXIT_RC(rc);
    144145       
    145146        async_set_fallback_port_handler(ns_connection, NULL);
  • uspace/srv/test/chardev-test/main.c

    rcde999a r84a1a54  
    3535#include <mem.h>
    3636#include <stdio.h>
     37#include <stdlib.h>
    3738#include <task.h>
    3839
     
    114115        if (rc != EOK) {
    115116                printf("%s: Failed registering server.: %s\n", NAME, str_error(rc));
    116                 return rc;
     117                return EXIT_RC(rc);
    117118        }
    118119
     
    132133        if (rc != EOK) {
    133134                printf("%s: Failed registering service.: %s\n", NAME, str_error(rc));
    134                 return rc;
     135                return EXIT_RC(rc);
    135136        }
    136137
     
    138139        if (rc != EOK) {
    139140                printf("%s: Failed registering service.: %s\n", NAME, str_error(rc));
    140                 return rc;
     141                return EXIT_RC(rc);
    141142        }
    142143
     
    144145        if (rc != EOK) {
    145146                printf("%s: Failed registering service.: %s\n", NAME, str_error(rc));
    146                 return rc;
     147                return EXIT_RC(rc);
    147148        }
    148149
  • uspace/srv/vfs/vfs.c

    rcde999a r84a1a54  
    9898                printf("%s: Failed to initialize VFS node hash table\n",
    9999                    NAME);
    100                 return ENOMEM;
     100                return EXIT_RC(ENOMEM);
    101101        }
    102102       
     
    108108        if (plb == AS_MAP_FAILED) {
    109109                printf("%s: Cannot create address space area\n", NAME);
    110                 return ENOMEM;
     110                return EXIT_RC(ENOMEM);
    111111        }
    112112        memset(plb, 0, PLB_SIZE);
     
    125125        if (rc != EOK) {
    126126                printf("%s: Cannot create pager port: %s\n", NAME, str_error(rc));
    127                 return rc;
     127                return EXIT_RC(rc);
    128128        }
    129129
     
    145145        if (rc != EOK) {
    146146                printf("%s: Cannot register VFS service: %s\n", NAME, str_error(rc));
    147                 return rc;
     147                return EXIT_RC(rc);
    148148        }
    149149       
Note: See TracChangeset for help on using the changeset viewer.