Changeset ff381a7 in mainline for uspace/app


Ignore:
Timestamp:
2015-11-02T20:54:19Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d8513177
Parents:
3feeab2 (diff), 5265eea4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

Location:
uspace/app
Files:
45 edited

Legend:

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

    r3feeab2 rff381a7  
    267267                        link_initialize(&dev->link);
    268268                        dev->svc_id = svcs[i];
    269                         dev->sess = loc_service_connect(EXCHANGE_SERIALIZE, svcs[i], 0);
     269                        dev->sess = loc_service_connect(svcs[i], INTERFACE_DDF, 0);
    270270                       
    271271                        list_append(&dev->link, &led_devs);
  • uspace/app/bdsh/cmds/builtins/cd/cd.c

    r3feeab2 rff381a7  
    5757        previous_directory_set = true;
    5858
    59         int rc = chdir(new_dir);
    60         if (rc != EOK) {
    61                 return rc;
    62         }
     59        if (chdir(new_dir) != 0)
     60                return errno;
    6361
    6462        str_cpy(previous_directory, PATH_MAX, previous_directory_tmp);
  • uspace/app/bdsh/cmds/modules/cat/cat.c

    r3feeab2 rff381a7  
    244244               
    245245                bytes = read(fd, buff + copied_bytes, bytes_to_read);
    246                 bytes += copied_bytes;
    247246                copied_bytes = 0;
    248247
  • uspace/app/bdsh/cmds/modules/cp/cp.c

    r3feeab2 rff381a7  
    2727 */
    2828
     29#include <errno.h>
    2930#include <stdio.h>
    3031#include <stdlib.h>
     
    8485        int r = stat(path, &s);
    8586
    86         if (r)
     87        if (r != 0)
    8788                return TYPE_NONE;
    8889        else if (s.is_directory)
     
    234235                         */
    235236                        if (force && !interactive) {
    236                                 if (unlink(dest_path)) {
     237                                if (unlink(dest_path) != 0) {
    237238                                        printf("Unable to remove %s\n",
    238239                                            dest_path);
     
    245246                                if (overwrite) {
    246247                                        printf("Overwriting file: %s\n", dest_path);
    247                                         if (unlink(dest_path)) {
     248                                        if (unlink(dest_path) != 0) {
    248249                                                printf("Unable to remove %s\n", dest_path);
    249250                                                goto exit;
     
    294295                                merge_paths(dest_path, PATH_MAX, src_dirname);
    295296
    296                                 if (mkdir(dest_path, 0) == -1) {
     297                                if (mkdir(dest_path, 0) != 0) {
    297298                                        printf("Unable to create "
    298299                                            "dest directory %s\n", dest_path);
     
    308309                         * e.g. cp -r /src /data/new_dir_src
    309310                         */
    310                         if (mkdir(dest_path, 0)) {
     311                        if (mkdir(dest_path, 0) != 0) {
    311312                                printf("Unable to create "
    312313                                    "dest directory %s\n", dest_path);
     
    405406        }
    406407
    407         while ((bytes = read_all(fd1, buff, blen)) > 0) {
    408                 if ((bytes = write_all(fd2, buff, bytes)) < 0)
     408        while ((bytes = read(fd1, buff, blen)) > 0) {
     409                if ((bytes = write(fd2, buff, bytes)) < 0)
    409410                        break;
    410411                copied += bytes;
     
    412413
    413414        if (bytes < 0) {
    414                 printf("\nError copying %s, (%d)\n", src, bytes);
     415                printf("\nError copying %s, (%d)\n", src, errno);
    415416                copied = bytes;
    416417        }
  • uspace/app/bdsh/cmds/modules/ls/ls.c

    r3feeab2 rff381a7  
    3131 * As more stuff is completed and exposed in libc, this will improve */
    3232
     33#include <errno.h>
    3334#include <stdio.h>
    3435#include <stdlib.h>
     
    187188                if (rc != 0) {
    188189                        printf("ls: skipping bogus node %s\n", buff);
    189                         printf("rc=%d\n", rc);
     190                        printf("error=%d\n", errno);
    190191                        goto out;
    191192                }
     
    314315static unsigned int ls_scope(const char *path, struct dir_elem_t *de)
    315316{
    316         if (stat(path, &de->s)) {
     317        if (stat(path, &de->s) != 0) {
    317318                cli_error(CL_ENOENT, "%s", path);
    318319                return LS_BOGUS;
     
    376377                }
    377378        }
    378        
     379
    379380        argc -= optind;
    380        
     381
    381382        de.name = (char *) malloc(PATH_MAX);
    382383        if (!de.name) {
    383                 cli_error(CL_ENOMEM, "%s: ", cmdname);
     384                cli_error(CL_ENOMEM, "%s: Out of memory", cmdname);
    384385                return CMD_FAILURE;
    385386        }
    386387        memset(de.name, 0, PATH_MAX);
    387        
    388         if (argc == 0)
    389                 getcwd(de.name, PATH_MAX);
    390         else
     388
     389        if (argc == 0) {
     390                if (getcwd(de.name, PATH_MAX) == NULL) {
     391                        cli_error(CL_EFAIL, "%s: Failed determining working "
     392                            "directory", cmdname);
     393                        return CMD_FAILURE;
     394                }
     395        } else {
    391396                str_cpy(de.name, PATH_MAX, argv[optind]);
     397        }
    392398
    393399        scope = ls_scope(de.name, &de);
  • uspace/app/bdsh/cmds/modules/mkdir/mkdir.c

    r3feeab2 rff381a7  
    8989{
    9090        /* Ensure we would always work with absolute and canonified path. */
    91         char *path = absolutize(user_path, NULL);
     91        char *path = vfs_absolutize(user_path, NULL);
    9292        if (path == NULL) {
    9393                cli_error(CL_ENOMEM, "%s: path too big?", cmdname);
     
    9595        }
    9696
    97         int rc;
    9897        int ret = 0;
    9998
    10099        if (!create_parents) {
    101                 rc = mkdir(path, 0);
    102                 if (rc != EOK) {
     100                if (mkdir(path, 0) != 0) {
    103101                        cli_error(CL_EFAIL, "%s: could not create %s (%s)",
    104                             cmdname, path, str_error(rc));
     102                            cmdname, path, str_error(errno));
    105103                        ret = 1;
    106104                }
     
    137135                        char slash_char = path[prev_off];
    138136                        path[prev_off] = 0;
    139                         rc = mkdir(path, 0);
    140                         if (rc == EEXIST) {
    141                                 rc = EOK;
    142                         }
    143 
    144                         if (rc != EOK) {
     137
     138                        if (mkdir(path, 0) != 0 && errno != EEXIST) {
    145139                                cli_error(CL_EFAIL, "%s: could not create %s (%s)",
    146                                     cmdname, path, str_error(rc));
     140                                    cmdname, path, str_error(errno));
    147141                                ret = 1;
    148142                                goto leave;
     
    152146                }
    153147                /* Create the final directory. */
    154                 rc = mkdir(path, 0);
    155                 if (rc != EOK) {
     148                if (mkdir(path, 0) != 0) {
    156149                        cli_error(CL_EFAIL, "%s: could not create %s (%s)",
    157                             cmdname, path, str_error(rc));
     150                            cmdname, path, str_error(errno));
    158151                        ret = 1;
    159152                }
     
    214207
    215208        if (follow && (argv[optind] != NULL)) {
    216                 chdir(argv[optind]);
     209                if (chdir(argv[optind]) != 0)
     210                        printf("%s: Error switching to directory.", cmdname);
    217211        }
    218212
  • uspace/app/bdsh/cmds/modules/mkfile/mkfile.c

    r3feeab2 rff381a7  
    2727 */
    2828
     29#include <errno.h>
    2930#include <stdio.h>
    3031#include <stdlib.h>
     
    166167
    167168                if ((rc2 = lseek(fd, file_size - 1, SEEK_SET)) < 0)
    168                         goto exit;
     169                        goto error;
    169170
    170171                rc2 = write(fd, &byte, sizeof(char));
    171                 goto exit;
     172                if (rc2 < 0)
     173                        goto error;
     174                return CMD_SUCCESS;
    172175        }
    173176
     
    183186                rc = write(fd, buffer, to_write);
    184187                if (rc <= 0) {
    185                         printf("%s: Error writing file (%zd).\n", cmdname, rc);
     188                        printf("%s: Error writing file (%d).\n", cmdname, errno);
    186189                        close(fd);
    187190                        return CMD_FAILURE;
     
    191194
    192195        free(buffer);
    193 exit:
    194         rc = close(fd);
    195 
    196         if (rc != 0 || rc2 < 0) {
    197                 printf("%s: Error writing file (%zd).\n", cmdname, rc);
    198                 return CMD_FAILURE;
    199         }
     196
     197        if (close(fd) < 0)
     198                goto error;
    200199
    201200        return CMD_SUCCESS;
     201error:
     202        printf("%s: Error writing file (%d).\n", cmdname, errno);
     203        return CMD_FAILURE;
    202204}
  • uspace/app/bdsh/cmds/modules/mount/mount.c

    r3feeab2 rff381a7  
    7272        int rc;
    7373
    74         get_mtab_list(&mtab_list);
     74        vfs_get_mtab_list(&mtab_list);
    7575
    7676        list_foreach(mtab_list, link, mtab_ent_t, mtab_ent) {
     
    150150                mopts = t_argv[4];
    151151
    152         rc = mount(t_argv[1], t_argv[2], dev, mopts, 0, instance);
     152        rc = vfs_mount(t_argv[1], t_argv[2], dev, mopts, 0, instance);
    153153        if (rc != EOK) {
    154154                printf("Unable to mount %s filesystem to %s on %s (rc=%d)\n",
  • uspace/app/bdsh/cmds/modules/mv/mv.c

    r3feeab2 rff381a7  
    6060
    6161        rc = rename(argv[1], argv[2]);
    62         if (rc != EOK) {
    63                 printf("Unable to rename %s to %s (rc=%d)\n",
    64                     argv[1], argv[2], rc);
     62        if (rc != 0) {
     63                printf("Unable to rename %s to %s (error=%d)\n",
     64                    argv[1], argv[2], errno);
    6565                return CMD_FAILURE;
    6666        }
  • uspace/app/bdsh/cmds/modules/pwd/pwd.c

    r3feeab2 rff381a7  
    5656
    5757        memset(buff, 0, PATH_MAX);
    58         getcwd(buff, PATH_MAX);
    5958
    60         if (! buff) {
     59        if (getcwd(buff, PATH_MAX) == NULL) {
    6160                cli_error(CL_EFAIL,
    6261                        "Unable to determine the current working directory");
  • uspace/app/bdsh/cmds/modules/rm/rm.c

    r3feeab2 rff381a7  
    2727 */
    2828
     29#include <errno.h>
    2930#include <stdio.h>
    3031#include <stdlib.h>
     
    131132static unsigned int rm_single(const char *path)
    132133{
    133         if (unlink(path)) {
     134        if (unlink(path) != 0) {
    134135                cli_error(CL_EFAIL, "rm: could not remove file %s", path);
    135136                return 1;
     
    150151
    151152        fd = open(path, O_RDONLY);
    152         if (fd > 0) {
     153        if (fd >= 0) {
    153154                close(fd);
    154155                return RM_FILE;
     
    210211        rc = rmdir(path);
    211212        if (rc == 0)
    212                 return ret;
     213                return errno;
    213214
    214215        cli_error(CL_ENOTSUP, "Can not remove %s", path);
  • uspace/app/bdsh/cmds/modules/touch/touch.c

    r3feeab2 rff381a7  
    123123               
    124124                /* Check whether file exists if -c (--no-create) option is given */
    125                 if ((!no_create) || ((no_create) && (stat(buff, &file_stat) == EOK)))
     125                if ((!no_create) || ((no_create) && (stat(buff, &file_stat) == 0)))
    126126                        fd = open(buff, O_RDWR | O_CREAT);
    127127               
  • uspace/app/bdsh/cmds/modules/unmount/unmount.c

    r3feeab2 rff381a7  
    6666        }
    6767
    68         rc = unmount(argv[1]);
     68        rc = vfs_unmount(argv[1]);
    6969        if (rc != EOK) {
    7070                printf("Unable to unmount %s (rc=%d)\n", argv[1], rc);
  • uspace/app/bdsh/compl.c

    r3feeab2 rff381a7  
    360360                                asprintf(&ent_path, "%s/%s", *cs->path, dent->d_name);
    361361                                struct stat ent_stat;
    362                                 if (stat(ent_path, &ent_stat) != EOK) {
     362                                if (stat(ent_path, &ent_stat) != 0) {
    363363                                        /* Error */
    364364                                        free(ent_path);
  • uspace/app/bdsh/config.h

    r3feeab2 rff381a7  
    4646/* How many words (arguments) are permitted, how big can a whole
    4747 * sentence be? Similar to ARG_MAX */
    48 #define WORD_MAX 255
    49 #define INPUT_MAX 1024
     48#define WORD_MAX 1023
     49#define INPUT_MAX 4096
    5050
    5151/* Leftovers from Autoconf */
  • uspace/app/bdsh/errors.h

    r3feeab2 rff381a7  
    4242#define CL_ENOTSUP 6
    4343#define CL_EEXEC   7
    44 #define CL_EEXISTS 8
     44#define CL_EEXIST  8
    4545#define CL_ETOOBIG 9
    4646
  • uspace/app/bdsh/exec.c

    r3feeab2 rff381a7  
    6161
    6262        fd = open(f, O_RDONLY);
    63         if (fd > -1) {
     63        if (fd >= 0) {
    6464                close(fd);
    6565                return 0;
     
    113113       
    114114        for (i = 0; i < 3 && files[i] != NULL; i++) {
    115                 if (fhandle(files[i], &file_handles[i]) == EOK) {
     115                if (vfs_fhandle(files[i], &file_handles[i]) == EOK) {
    116116                        file_handles_p[i] = &file_handles[i];
    117117                }
  • uspace/app/blkdump/blkdump.c

    r3feeab2 rff381a7  
    142142        }
    143143
    144         rc = block_init(EXCHANGE_SERIALIZE, service_id, 2048);
     144        rc = block_init(service_id, 2048);
    145145        if (rc != EOK)  {
    146146                printf(NAME ": Error initializing libblock.\n");
  • uspace/app/date/date.c

    r3feeab2 rff381a7  
    136136
    137137        /* Connect to the device */
    138         async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE,
    139             svc_id, 0);
     138        async_sess_t *sess = loc_service_connect(svc_id, INTERFACE_DDF, 0);
    140139        if (!sess) {
    141140                printf(NAME ": Cannot connect to the device\n");
  • uspace/app/df/df.c

    r3feeab2 rff381a7  
    119119
    120120        LIST_INITIALIZE(mtab_list);
    121         get_mtab_list(&mtab_list);
     121        vfs_get_mtab_list(&mtab_list);
    122122
    123123        print_header();
    124124        list_foreach(mtab_list, link, mtab_ent_t, mtab_ent) {
    125                 statfs(mtab_ent->mp, &st);
    126                 print_statfs(&st, mtab_ent->fs_name, mtab_ent->mp);
     125                if (statfs(mtab_ent->mp, &st) == 0) {
     126                        print_statfs(&st, mtab_ent->fs_name, mtab_ent->mp);
     127                } else {
     128                        fprintf(stderr, "Cannot get information for '%s' (%d).\n",
     129                            mtab_ent->mp, errno);
     130                }
    127131        }
    128132
  • uspace/app/hdisk/hdisk.c

    r3feeab2 rff381a7  
    8282        label.device = dev_handle;
    8383       
    84         rc = block_init(EXCHANGE_ATOMIC, dev_handle, 512);
     84        rc = block_init(dev_handle, 512);
    8585        if (rc != EOK) {
    8686                printf("Error during libblock init: %d - %s.\n", rc, str_error(rc));
  • uspace/app/init/init.c

    r3feeab2 rff381a7  
    126126                opts = "restore";
    127127       
    128         int rc = mount(fstype, ROOT_MOUNT_POINT, ROOT_DEVICE, opts,
     128        int rc = vfs_mount(fstype, ROOT_MOUNT_POINT, ROOT_DEVICE, opts,
    129129            IPC_FLAG_BLOCKING, 0);
    130130        return mount_report("Root filesystem", ROOT_MOUNT_POINT, fstype,
     
    143143static bool mount_locfs(void)
    144144{
    145         int rc = mount(LOCFS_FS_TYPE, LOCFS_MOUNT_POINT, "", "",
     145        int rc = vfs_mount(LOCFS_FS_TYPE, LOCFS_MOUNT_POINT, "", "",
    146146            IPC_FLAG_BLOCKING, 0);
    147147        return mount_report("Location service filesystem", LOCFS_MOUNT_POINT,
     
    152152{
    153153        struct stat s;
    154         if (stat(path, &s) == ENOENT) {
     154        if (stat(path, &s) != 0) {
    155155                printf("%s: Unable to stat %s\n", NAME, path);
    156156                return ENOENT;
     
    299299static bool mount_tmpfs(void)
    300300{
    301         int rc = mount(TMPFS_FS_TYPE, TMPFS_MOUNT_POINT, "", "", 0, 0);
     301        int rc = vfs_mount(TMPFS_FS_TYPE, TMPFS_MOUNT_POINT, "", "", 0, 0);
    302302        return mount_report("Temporary filesystem", TMPFS_MOUNT_POINT,
    303303            TMPFS_FS_TYPE, NULL, rc);
  • uspace/app/mixerctl/mixerctl.c

    r3feeab2 rff381a7  
    155155        }
    156156
    157         async_sess_t *session = loc_service_connect(
    158             EXCHANGE_ATOMIC, mixer_sid, 0);
     157        async_sess_t *session = loc_service_connect(mixer_sid, INTERFACE_DDF, 0);
    159158        if (!session) {
    160159                printf("Failed connecting mixer service '%s'.\n", service);
  • uspace/app/mkbd/main.c

    r3feeab2 rff381a7  
    231231        }
    232232       
    233         async_sess_t *sess = devman_device_connect(EXCHANGE_SERIALIZE,
    234             dev_handle, 0);
     233        async_sess_t *sess = devman_device_connect(dev_handle, 0);
    235234        if (!sess) {
    236235                printf(NAME ": failed to connect to the device (handle %"
  • uspace/app/mkexfat/mkexfat.c

    r3feeab2 rff381a7  
    803803        }
    804804
    805         rc = block_init(EXCHANGE_SERIALIZE, service_id, 2048);
     805        rc = block_init(service_id, 2048);
    806806        if (rc != EOK) {
    807807                printf(NAME ": Error initializing libblock.\n");
  • uspace/app/mkfat/mkfat.c

    r3feeab2 rff381a7  
    162162        }
    163163
    164         rc = block_init(EXCHANGE_SERIALIZE, service_id, 2048);
     164        rc = block_init(service_id, 2048);
    165165        if (rc != EOK)  {
    166166                printf(NAME ": Error initializing libblock.\n");
  • uspace/app/mkmfs/mkmfs.c

    r3feeab2 rff381a7  
    209209        }
    210210
    211         rc = block_init(EXCHANGE_SERIALIZE, service_id, 2048);
     211        rc = block_init(service_id, 2048);
    212212        if (rc != EOK)  {
    213213                printf(NAME ": Error initializing libblock.\n");
  • uspace/app/nic/nic.c

    r3feeab2 rff381a7  
    9999        printf("Using device: %s\n", svc_name);
    100100
    101         sess = loc_service_connect(EXCHANGE_SERIALIZE, nics[i], 0);
     101        sess = loc_service_connect(nics[i], INTERFACE_DDF, 0);
    102102        if (sess == NULL) {
    103103                printf("Error connecting to service.\n");
     
    117117        int rc;
    118118
    119         sess = loc_service_connect(EXCHANGE_SERIALIZE, svc_id, 0);
     119        sess = loc_service_connect(svc_id, INTERFACE_DDF, 0);
    120120        if (sess == NULL) {
    121121                printf("Error connecting to service.\n");
    122122                goto error;
    123123        }
    124 
     124       
    125125        rc = nic_get_address(sess, &info->address);
    126126        if (rc != EOK) {
  • uspace/app/sportdmp/sportdmp.c

    r3feeab2 rff381a7  
    111111
    112112
    113         async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE, svc_id,
     113        async_sess_t *sess = loc_service_connect(svc_id, INTERFACE_DDF,
    114114            IPC_FLAG_BLOCKING);
    115115        if (!sess) {
  • uspace/app/taskdump/elf_core.c

    r3feeab2 rff381a7  
    207207        }
    208208
    209         rc = write_all(fd, &elf_hdr, sizeof(elf_hdr));
     209        rc = write(fd, &elf_hdr, sizeof(elf_hdr));
    210210        if (rc != sizeof(elf_hdr)) {
    211211                printf("Failed writing ELF header.\n");
     
    215215
    216216        for (i = 0; i < n_ph; ++i) {
    217                 rc = write_all(fd, &p_hdr[i], sizeof(p_hdr[i]));
     217                rc = write(fd, &p_hdr[i], sizeof(p_hdr[i]));
    218218                if (rc != sizeof(p_hdr[i])) {
    219219                        printf("Failed writing program header.\n");
     
    236236        note.type = NT_PRSTATUS;
    237237
    238         rc = write_all(fd, &note, sizeof(elf_note_t));
     238        rc = write(fd, &note, sizeof(elf_note_t));
    239239        if (rc != sizeof(elf_note_t)) {
    240240                printf("Failed writing note header.\n");
     
    243243        }
    244244
    245         rc = write_all(fd, "CORE", note.namesz);
     245        rc = write(fd, "CORE", note.namesz);
    246246        if (rc != (ssize_t) note.namesz) {
    247247                printf("Failed writing note header.\n");
     
    257257        }
    258258
    259         rc = write_all(fd, &pr_status, sizeof(elf_prstatus_t));
     259        rc = write(fd, &pr_status, sizeof(elf_prstatus_t));
    260260        if (rc != sizeof(elf_prstatus_t)) {
    261261                printf("Failed writing register data.\n");
     
    321321                }
    322322
    323                 rc = write_all(fd, buffer, to_copy);
     323                rc = write(fd, buffer, to_copy);
    324324                if (rc != (ssize_t) to_copy) {
    325325                        printf("Failed writing memory contents.\n");
  • uspace/app/taskdump/symtab.c

    r3feeab2 rff381a7  
    8888        }
    8989
    90         rc = read_all(fd, &elf_hdr, sizeof(elf_header_t));
     90        rc = read(fd, &elf_hdr, sizeof(elf_header_t));
    9191        if (rc != sizeof(elf_header_t)) {
    9292                printf("failed reading elf header\n");
     
    310310                return EIO;
    311311
    312         rc = read_all(fd, sec_hdr, sizeof(elf_section_header_t));
     312        rc = read(fd, sec_hdr, sizeof(elf_section_header_t));
    313313        if (rc != sizeof(elf_section_header_t))
    314314                return EIO;
     
    346346        }
    347347
    348         rc = read_all(fd, *ptr, size);
     348        rc = read(fd, *ptr, size);
    349349        if (rc != (ssize_t) size) {
    350350                printf("failed reading chunk\n");
  • uspace/app/tester/float/float2.c

    r3feeab2 rff381a7  
    11/*
    22 * Copyright (c) 2014 Martin Decky
     3 * Copyright (c) 2015 Jiri Svoboda
    34 * All rights reserved.
    45 *
     
    2728 */
    2829
     30#include <stdbool.h>
    2931#include <stdio.h>
    3032#include <stdlib.h>
     
    3234#include "../tester.h"
    3335
    34 #define OPERANDS   10
    35 #define PRECISION  100000000
     36#define OPERANDS         10
     37#define PRECISIONF    10000
     38#define PRECISION 100000000
    3639
    3740static double arguments[OPERANDS] = {
     
    3942};
    4043
    41 static double results_trunc[OPERANDS] = {
    42         3.0, -2.0, 100.0, 50.0, -1024.0, 0.0, 768.0, 1080.0, -600.0, 1.0
     44static double arguments_acos[OPERANDS] = {
     45        -0.936456687291, -0.504846104600, 0.862318872288, 0.964966028492,
     46        0.987353618220, 1.0, -0.194939922623, 0.978471923925, -0.999023478833,
     47        0.540302305868
     48};
     49
     50static double arguments_asin[OPERANDS] = {
     51        -0.350783227690, -0.863209366649, -0.506365641110, -0.262374853704,
     52        0.158533380044, 0.0, 0.980815184715, -0.206379975025, -0.044182448332,
     53        0.841470984808
     54};
     55
     56static double arguments_atan[OPERANDS] = {
     57        3.5, 100.0, 50.0, 768.3156, 1080.499999, 1.0, 66.0,
     58        2.718281828459045, 9.9, 0.001
     59};
     60
     61static double arguments_exp[OPERANDS] = {
     62        3.5, -2.1, 50.0, 0.0, 1.0, 13.2, -1.1, -5.5, 0.1, -66.0
     63};
     64
     65static double arguments_log[OPERANDS] = {
     66        3.5, 100.0, 50.0, 768.3156, 1080.499999, 1.0, 66.0,
     67        2.718281828459045, 9.9, 0.001
     68};
     69
     70static double arguments_sqrt[OPERANDS] = {
     71        3.5, 100.0, 50.0, 768.3156, 1080.499999, 1.0, 66.0,
     72        2.718281828459045, 9.9, 0.001
     73};
     74
     75static double arguments_tanh[OPERANDS] = {
     76        3.5, -2.1, 50.0, 0.0, 1.0, 13.2, -1.1, -5.5, 0.000001, -66000000.0
     77};
     78
     79static double results_acos[OPERANDS] = {
     80        2.783185307180, 2.100000000000, 0.530964914873, 0.265482457437,
     81        0.159205070272, 0.000000000000, 1.766992524091, 0.207873834887,
     82        3.097395817941, 1.000000000000
     83};
     84
     85static double results_asin[OPERANDS] = {
     86        -0.358407346411, -1.041592653590, -0.530964914874, -0.265482457437,
     87        0.159205070273, 0.000000000000, 1.374600129498, -0.207873834889,
     88        -0.044196835651, 1.000000000000
     89};
     90
     91static double results_atan[OPERANDS] = {
     92        1.292496667790, 1.560796660108, 1.550798992822, 1.569494779052,
     93        1.569870829603, 0.785398163397, 1.555645970920, 1.218282905017,
     94        1.470127674637, 0.000999999667
     95};
     96
     97static double results_ceil[OPERANDS] = {
     98        4.0, -2.0, 100.0, 50.0, -1024.0, 0.0, 769.0, 1081.0, -600.0, 1.0
     99};
     100
     101static double results_cos[OPERANDS] = {
     102        -0.936456687291, -0.504846104600, 0.862318872288, 0.964966028492,
     103        0.987353618220, 1.0, -0.194939922623, 0.978471923925, -0.999023478833,
     104        0.540302305868
     105};
     106
     107static double results_cosh[OPERANDS] = {
     108        16.572824671057, 4.144313170410, 2592352764293536022528.000000000000,
     109        1.000000000000, 1.543080634815, 270182.468624271103, 1.668518553822,
     110        122.348009517829, 1.005004168056, 23035933171656458903220125696.0
     111};
     112
     113static double results_fabs[OPERANDS] = {
     114        3.5, 2.1, 100.0, 50.0, 1024.0, 0.0, 768.3156, 1080.499999, 600.0, 1.0
     115};
     116
     117static double results_floor[OPERANDS] = {
     118        3.0, -3.0, 100.0, 50.0, -1024.0, 0.0, 768.0, 1080.0, -600.0, 1.0
     119};
     120
     121static double results_exp[OPERANDS] = {
     122        33.115451958692, 0.122456428253, 5184705528587072045056.0,
     123        1.000000000000, 2.718281828459, 540364.937246691552, 0.332871083698,
     124        0.004086771438, 1.105170918076, 0.000000000000
     125};
     126
     127static double results_log[OPERANDS] = {
     128        1.252762968495, 4.605170185988, 3.912023005428, 6.644200586236,
     129        6.985179175021, 0.000000000000, 4.189654742026, 1.000000000000,
     130        2.292534757141, -6.907755278982
     131};
     132
     133static double results_log10[OPERANDS] = {
     134        0.544068044350, 2.000000000000, 1.698970004336, 2.885539651261,
     135        3.033624770817, 0.000000000000, 1.819543935542, 0.434294481903,
     136        0.995635194598, -3.000000000000
    43137};
    44138
     
    49143};
    50144
    51 static double results_cos[OPERANDS] = {
    52         -0.936456687291, -0.504846104600, 0.862318872288, 0.964966028492,
    53         0.987353618220, 1.0, -0.194939922623, 0.978471923925, -0.999023478833,
    54         0.540302305868
    55 };
     145static double results_sinh[OPERANDS] = {
     146        16.542627287635, -4.021856742157, 2592352764293536022528.000000000000,
     147        0.000000000000, 1.175201193644, 270182.468622420449, -1.335647470124,
     148        -122.343922746391, 0.100166750020, -23035933171656458903220125696.0
     149};
     150
     151static double results_sqrt[OPERANDS] = {
     152        1.870828693387, 10.000000000000, 7.071067811865, 27.718506453271,
     153        32.870959812576, 1.000000000000, 8.124038404636, 1.648721270700,
     154        3.146426544510, 0.031622776602
     155};
     156
     157static double results_tan[OPERANDS] = {
     158        0.374585640159, 1.709846542905, -0.587213915157, -0.271900611998,
     159        0.160563932839, 0.000000000000, -5.031371570891, -0.210920691722,
     160        0.044225635601, 1.557407724655
     161};
     162
     163static double results_tanh[OPERANDS] = {
     164        0.998177897611, -0.970451936613, 1.000000000000, 0.000000000000,
     165        0.761594155956, 0.999999999993, -0.800499021761, -0.999966597156,
     166        0.000001000000, -1.000000000000
     167};
     168
     169static double results_trunc[OPERANDS] = {
     170        3.0, -2.0, 100.0, 50.0, -1024.0, 0.0, 768.0, 1080.0, -600.0, 1.0
     171};
     172
     173static bool cmp_float(float a, float b)
     174{
     175        float r;
     176
     177        /* XXX Need fabsf() */
     178        if (b < 1.0 / PRECISIONF && b > -1.0 / PRECISIONF)
     179                r = a;
     180        else
     181                r = a / b - 1.0;
     182
     183        /* XXX Need fabsf() */
     184        if (r < 0.0)
     185                r = -r;
     186
     187        return r < 1.0 / PRECISIONF;
     188}
     189
     190static bool cmp_double(double a, double b)
     191{
     192        double r;
     193
     194        /* XXX Need fabs() */
     195        if (b < 1.0 / PRECISION && b > -1.0 / PRECISION)
     196                r = a;
     197        else
     198                r = a / b - 1.0;
     199
     200        /* XXX Need fabs() */
     201        if (r < 0.0)
     202                r = -r;
     203
     204        return r < 1.0 / PRECISION;
     205}
    56206
    57207const char *test_float2(void)
    58208{
    59209        bool fail = false;
    60        
     210if (0) {
     211        for (unsigned int i = 0; i < OPERANDS; i++) {
     212                double res = acos(arguments_acos[i]);
     213
     214                if (!cmp_double(res, results_acos[i])) {
     215                        TPRINTF("Double precision acos failed "
     216                            "(%lf != %lf, arg %u)\n", res, results_acos[i], i);
     217                        fail = true;
     218                }
     219        }
     220
     221        for (unsigned int i = 0; i < OPERANDS; i++) {
     222                float res = acosf(arguments_acos[i]);
     223
     224                if (!cmp_float(res, results_acos[i])) {
     225                        TPRINTF("Single precision acos failed "
     226                            "(%f != %lf, arg %u)\n", res, results_acos[i], i);
     227                        fail = true;
     228                }
     229        }
     230
     231        for (unsigned int i = 0; i < OPERANDS; i++) {
     232                double res = asin(arguments_asin[i]);
     233
     234                if (!cmp_double(res, results_asin[i])) {
     235                        TPRINTF("Double precision asin failed "
     236                            "(%lf != %lf, arg %u)\n", res, results_asin[i], i);
     237                        fail = true;
     238                }
     239        }
     240
     241        for (unsigned int i = 0; i < OPERANDS; i++) {
     242                float res = asinf(arguments_asin[i]);
     243
     244                if (!cmp_float(res, results_asin[i])) {
     245                        TPRINTF("Single precision asin failed "
     246                            "(%f != %lf, arg %u)\n", res, results_asin[i], i);
     247                        fail = true;
     248                }
     249        }
     250}
     251        for (unsigned int i = 0; i < OPERANDS; i++) {
     252                double res = atan(arguments_atan[i]);
     253
     254                if (!cmp_double(res, results_atan[i])) {
     255                        TPRINTF("Double precision atan failed "
     256                            "(%.12lf != %.12lf, arg %u)\n", res, results_atan[i], i);
     257                        fail = true;
     258                }
     259        }
     260
     261        for (unsigned int i = 0; i < OPERANDS; i++) {
     262                float res = atanf(arguments_atan[i]);
     263
     264                if (!cmp_float(res, results_atan[i])) {
     265                        TPRINTF("Single precision atan failed "
     266                            "(%f != %lf, arg %u)\n", res, results_atan[i], i);
     267                        fail = true;
     268                }
     269        }
     270
     271        for (unsigned int i = 0; i < OPERANDS; i++) {
     272                double res = ceil(arguments[i]);
     273
     274                if (!cmp_double(res, results_ceil[i])) {
     275                        TPRINTF("Double precision ceil failed "
     276                            "(%lf != %lf, arg %u)\n", res, results_ceil[i], i);
     277                        fail = true;
     278                }
     279        }
     280
     281        for (unsigned int i = 0; i < OPERANDS; i++) {
     282                float res = ceilf(arguments[i]);
     283
     284                if (!cmp_float(res, results_ceil[i])) {
     285                        TPRINTF("Single precision ceil failed "
     286                            "(%f != %lf, arg %u)\n", res, results_ceil[i], i);
     287                        fail = true;
     288                }
     289        }
     290
     291        for (unsigned int i = 0; i < OPERANDS; i++) {
     292                double res = cos(arguments[i]);
     293
     294                if (!cmp_double(res, results_cos[i])) {
     295                        TPRINTF("Double precision cos failed "
     296                            "(%lf != %lf, arg %u)\n", res, results_cos[i], i);
     297                        fail = true;
     298                }
     299        }
     300
     301        for (unsigned int i = 0; i < OPERANDS; i++) {
     302                float res = cosf(arguments[i]);
     303
     304                if (!cmp_float(res, results_cos[i])) {
     305                        TPRINTF("Single precision cos failed "
     306                            "(%f != %lf, arg %u)\n", res, results_cos[i], i);
     307                        fail = true;
     308                }
     309        }
     310
     311        for (unsigned int i = 0; i < OPERANDS; i++) {
     312                double res = cosh(arguments_exp[i]);
     313
     314                if (!cmp_double(res, results_cosh[i])) {
     315                        TPRINTF("Double precision cosh failed "
     316                            "(%lf != %lf, arg %u)\n", res, results_cosh[i], i);
     317                        fail = true;
     318                }
     319        }
     320
     321        for (unsigned int i = 0; i < OPERANDS; i++) {
     322                float res = coshf(arguments_exp[i]);
     323
     324                if (!cmp_float(res, results_cosh[i])) {
     325                        TPRINTF("Single precision cosh failed "
     326                            "(%f != %lf, arg %u)\n", res, results_cosh[i], i);
     327                        fail = true;
     328                }
     329        }
     330
     331        for (unsigned int i = 0; i < OPERANDS; i++) {
     332                double res = exp(arguments_exp[i]);
     333
     334                if (!cmp_double(res, results_exp[i])) {
     335                        TPRINTF("Double precision exp failed "
     336                            "(%lf != %lf, arg %u)\n", res, results_exp[i], i);
     337                        fail = true;
     338                }
     339        }
     340
     341        for (unsigned int i = 0; i < OPERANDS; i++) {
     342                float res = expf(arguments_exp[i]);
     343
     344                if (!cmp_float(res, results_exp[i])) {
     345                        TPRINTF("Single precision exp failed "
     346                            "(%f != %lf, arg %u)\n", res, results_exp[i], i);
     347                        fail = true;
     348                }
     349        }
     350
     351        for (unsigned int i = 0; i < OPERANDS; i++) {
     352                double res = fabs(arguments[i]);
     353
     354                if (!cmp_double(res, results_fabs[i])) {
     355                        TPRINTF("Double precision fabs failed "
     356                            "(%lf != %lf, arg %u)\n", res, results_fabs[i], i);
     357                        fail = true;
     358                }
     359        }
     360
     361        for (unsigned int i = 0; i < OPERANDS; i++) {
     362                float res = fabsf(arguments[i]);
     363
     364                if (!cmp_float(res, results_fabs[i])) {
     365                        TPRINTF("Single precision fabs failed "
     366                            "(%f != %lf, arg %u)\n", res, results_fabs[i], i);
     367                        fail = true;
     368                }
     369        }
     370
     371        for (unsigned int i = 0; i < OPERANDS; i++) {
     372                double res = floor(arguments[i]);
     373
     374                if (!cmp_double(res, results_floor[i])) {
     375                        TPRINTF("Double precision floor failed "
     376                            "(%lf != %lf, arg %u)\n", res, results_floor[i], i);
     377                        fail = true;
     378                }
     379        }
     380
     381        for (unsigned int i = 0; i < OPERANDS; i++) {
     382                float res = floorf(arguments[i]);
     383
     384                if (!cmp_float(res, results_floor[i])) {
     385                        TPRINTF("Single precision floor failed "
     386                            "(%f != %lf, arg %u)\n", res, results_floor[i], i);
     387                        fail = true;
     388                }
     389        }
     390
     391        for (unsigned int i = 0; i < OPERANDS; i++) {
     392                double res = log(arguments_log[i]);
     393
     394                if (!cmp_double(res, results_log[i])) {
     395                        TPRINTF("Double precision log failed "
     396                            "(%lf != %lf, arg %u)\n", res, results_log[i], i);
     397                        fail = true;
     398                }
     399        }
     400
     401        for (unsigned int i = 0; i < OPERANDS; i++) {
     402                float res = logf(arguments_log[i]);
     403
     404                if (!cmp_float(res, results_log[i])) {
     405                        TPRINTF("Single precision log failed "
     406                            "(%f != %lf, arg %u)\n", res, results_log[i], i);
     407                        fail = true;
     408                }
     409        }
     410
     411        for (unsigned int i = 0; i < OPERANDS; i++) {
     412                double res = log10(arguments_log[i]);
     413
     414                if (!cmp_double(res, results_log10[i])) {
     415                        TPRINTF("Double precision log10 failed "
     416                            "(%lf != %lf, arg %u)\n", res, results_log10[i], i);
     417                        fail = true;
     418                }
     419        }
     420
     421        for (unsigned int i = 0; i < OPERANDS; i++) {
     422                float res = log10f(arguments_log[i]);
     423
     424                if (!cmp_float(res, results_log10[i])) {
     425                        TPRINTF("Single precision log10 failed "
     426                            "(%f != %lf, arg %u)\n", res, results_log10[i], i);
     427                        fail = true;
     428                }
     429        }
     430
     431        for (unsigned int i = 0; i < OPERANDS; i++) {
     432                double res = sin(arguments[i]);
     433
     434                if (!cmp_double(res, results_sin[i])) {
     435                        TPRINTF("Double precision sin failed "
     436                            "(%lf != %lf, arg %u)\n", res, results_sin[i], i);
     437                        fail = true;
     438                }
     439        }
     440
     441        for (unsigned int i = 0; i < OPERANDS; i++) {
     442                float res = sinf(arguments[i]);
     443
     444                if (!cmp_float(res, results_sin[i])) {
     445                        TPRINTF("Single precision sin failed "
     446                            "(%f != %lf, arg %u)\n", res, results_sin[i], i);
     447                        fail = true;
     448                }
     449        }
     450;
     451        for (unsigned int i = 0; i < OPERANDS; i++) {
     452                double res = sinh(arguments_exp[i]);
     453
     454                if (!cmp_double(res, results_sinh[i])) {
     455                        TPRINTF("Double precision sinh failed "
     456                            "(%lf != %lf, arg %u)\n", res, results_sinh[i], i);
     457                        fail = true;
     458                }
     459        }
     460
     461        for (unsigned int i = 0; i < OPERANDS; i++) {
     462                float res = sinhf(arguments_exp[i]);
     463
     464                if (!cmp_float(res, results_sinh[i])) {
     465                        TPRINTF("Single precision sinh failed "
     466                            "(%f != %lf, arg %u)\n", res, results_sinh[i], i);
     467                        fail = true;
     468                }
     469        }
     470
     471        for (unsigned int i = 0; i < OPERANDS; i++) {
     472                double res = sqrt(arguments_sqrt[i]);
     473
     474                if (!cmp_double(res, results_sqrt[i])) {
     475                        TPRINTF("Double precision sqrt failed "
     476                            "(%lf != %lf, arg %u)\n", res, results_sqrt[i], i);
     477                        fail = true;
     478                }
     479        }
     480
     481        for (unsigned int i = 0; i < OPERANDS; i++) {
     482                float res = sqrtf(arguments_sqrt[i]);
     483
     484                if (!cmp_float(res, results_sqrt[i])) {
     485                        TPRINTF("Single precision sqrt failed "
     486                            "(%f != %lf, arg %u)\n", res, results_sqrt[i], i);
     487                        fail = true;
     488                }
     489        }
     490
     491        for (unsigned int i = 0; i < OPERANDS; i++) {
     492                double res = tan(arguments[i]);
     493
     494                if (!cmp_double(res, results_tan[i])) {
     495                        TPRINTF("Double precision tan failed "
     496                            "(%lf != %lf, arg %u)\n", res, results_tan[i], i);
     497                        fail = true;
     498                }
     499        }
     500
     501        for (unsigned int i = 0; i < OPERANDS; i++) {
     502                float res = tanf(arguments[i]);
     503
     504                if (!cmp_float(res, results_tan[i])) {
     505                        TPRINTF("Single precision tan failed "
     506                            "(%f != %lf, arg %u)\n", res, results_tan[i], i);
     507                        fail = true;
     508                }
     509        }
     510
     511        for (unsigned int i = 0; i < OPERANDS; i++) {
     512                double res = tanh(arguments_tanh[i]);
     513
     514                if (!cmp_double(res, results_tanh[i])) {
     515                        TPRINTF("Double precision tanh failed "
     516                            "(%lf != %lf, arg %u)\n", res, results_tanh[i], i);
     517                        fail = true;
     518                }
     519        }
     520
     521        for (unsigned int i = 0; i < OPERANDS; i++) {
     522                float res = tanhf(arguments_tanh[i]);
     523
     524                if (!cmp_float(res, results_tanh[i])) {
     525                        TPRINTF("Single precision tanh failed "
     526                            "(%f != %lf, arg %u)\n", res, results_tanh[i], i);
     527                        fail = true;
     528                }
     529        }
     530
    61531        for (unsigned int i = 0; i < OPERANDS; i++) {
    62532                double res = trunc(arguments[i]);
    63                 int64_t res_int = (int64_t) (res * PRECISION);
    64                 int64_t corr_int = (int64_t) (results_trunc[i] * PRECISION);
    65                
    66                 if (res_int != corr_int) {
    67                         TPRINTF("Double truncation failed (%" PRId64 " != %" PRId64
    68                             ", arg %u)\n", res_int, corr_int, i);
    69                         fail = true;
    70                 }
    71         }
    72        
    73         for (unsigned int i = 0; i < OPERANDS; i++) {
    74                 double res = sin(arguments[i]);
    75                 int64_t res_int = (int64_t) (res * PRECISION);
    76                 int64_t corr_int = (int64_t) (results_sin[i] * PRECISION);
    77                
    78                 if (res_int != corr_int) {
    79                         TPRINTF("Double sine failed (%" PRId64 " != %" PRId64
    80                             ", arg %u)\n", res_int, corr_int, i);
    81                         fail = true;
    82                 }
    83         }
    84        
    85         for (unsigned int i = 0; i < OPERANDS; i++) {
    86                 double res = cos(arguments[i]);
    87                 int64_t res_int = (int64_t) (res * PRECISION);
    88                 int64_t corr_int = (int64_t) (results_cos[i] * PRECISION);
    89                
    90                 if (res_int != corr_int) {
    91                         TPRINTF("Double cosine failed (%" PRId64 " != %" PRId64
    92                             ", arg %u)\n", res_int, corr_int, i);
    93                         fail = true;
    94                 }
    95         }
    96        
     533
     534                if (!cmp_double(res, results_trunc[i])) {
     535                        TPRINTF("Double precision trunc failed "
     536                            "(%lf != %lf, arg %u)\n", res, results_trunc[i], i);
     537                        fail = true;
     538                }
     539        }
     540
     541        for (unsigned int i = 0; i < OPERANDS; i++) {
     542                float res = truncf(arguments[i]);
     543
     544                if (!cmp_float(res, results_trunc[i])) {
     545                        TPRINTF("Single precision trunc failed "
     546                            "(%f != %lf, arg %u)\n", res, results_trunc[i], i);
     547                        fail = true;
     548                }
     549        }
     550
    97551        if (fail)
    98552                return "Floating point imprecision";
    99        
     553
    100554        return NULL;
    101555}
  • uspace/app/tester/hw/misc/virtchar1.c

    r3feeab2 rff381a7  
    5858        int fd = open(path, O_RDONLY);
    5959        if (fd < 0) {
    60                 TPRINTF("   ...error: %s\n", str_error(fd));
     60                TPRINTF("   ...error: %s\n", str_error(errno));
    6161                if (fd == ENOENT) {
    6262                        TPRINTF("   (error was ENOENT: " \
     
    6969       
    7070        TPRINTF(" Asking for session...\n");
    71         async_sess_t *sess = fd_session(EXCHANGE_SERIALIZE, fd);
     71        async_sess_t *sess = vfs_fd_session(fd, INTERFACE_DDF);
    7272        if (!sess) {
    7373                close(fd);
  • uspace/app/tester/hw/serial/serial1.c

    r3feeab2 rff381a7  
    7676                return "Failed getting serial port service ID";
    7777       
    78         async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE, svc_id,
     78        async_sess_t *sess = loc_service_connect(svc_id, INTERFACE_DDF,
    7979            IPC_FLAG_BLOCKING);
    8080        if (!sess)
  • uspace/app/tester/mm/common.c

    r3feeab2 rff381a7  
    309309                return NULL;
    310310       
    311         unsigned int idx = rand() % mem_blocks_count;
     311        unsigned long idx = rand() % mem_blocks_count;
    312312        link_t *entry = list_nth(&mem_blocks, idx);
    313313       
  • uspace/app/tester/tester.h

    r3feeab2 rff381a7  
    6060        do { \
    6161                if (!test_quiet) { \
    62                         fprintf(stderr, (format), ##__VA_ARGS__); \
     62                        fprintf(stdout, (format), ##__VA_ARGS__); \
    6363                } \
    6464        } while (0)
  • uspace/app/tester/vfs/vfs1.c

    r3feeab2 rff381a7  
    7070const char *test_vfs1(void)
    7171{
    72         int rc;
    73         if ((rc = mkdir(TEST_DIRECTORY, 0)) != 0) {
    74                 TPRINTF("rc=%d\n", rc);
     72        if (mkdir(TEST_DIRECTORY, 0) != 0) {
     73                TPRINTF("rc=%d\n", errno);
    7574                return "mkdir() failed";
    7675        }
     
    9392       
    9493        char buf[BUF_SIZE];
     94        TPRINTF("read..\n");
    9595        while ((cnt = read(fd0, buf, BUF_SIZE))) {
     96                TPRINTF("read returns %zd\n", cnt);
    9697                if (cnt < 0)
    9798                        return "read() failed";
     
    112113                return rv;
    113114       
    114         if (rename(TEST_FILE, TEST_FILE2))
     115        if (rename(TEST_FILE, TEST_FILE2) != 0)
    115116                return "rename() failed";
    116117        TPRINTF("Renamed %s to %s\n", TEST_FILE, TEST_FILE2);
    117118       
    118         if (unlink(TEST_FILE2))
     119        if (unlink(TEST_FILE2) != 0)
    119120                return "unlink() failed";
    120121        TPRINTF("Unlinked %s\n", TEST_FILE2);
    121122       
    122         if (rmdir(TEST_DIRECTORY))
     123        if (rmdir(TEST_DIRECTORY) != 0)
    123124                return "rmdir() failed";
    124125        TPRINTF("Removed directory %s\n", TEST_DIRECTORY);
  • uspace/app/tetris/scores.c

    r3feeab2 rff381a7  
    233233
    234234        f = fopen("/data/tetris.sco", "wb");
     235        if (f == NULL) {
     236                printf("Error creating table\n");
     237                return;
     238        }
     239       
    235240        cnt = fwrite(scores, sizeof(struct highscore), NUMSPOTS, f);
    236241        rc = fclose(f);
  • uspace/app/trace/errors.c

    r3feeab2 rff381a7  
    4646        [-EPERM]        = { "EPERM",            "Permission denied" },
    4747        [-EHANGUP]      = { "EHANGUP",          "Answerbox closed connection" },
    48         [-EEXISTS]      = { "EEXISTS",          "Entry already exists" },
     48        [-EEXIST]       = { "EEXIST",           "Entry already exists" },
    4949        [-EBADMEM]      = { "EBADMEM",          "Bad memory pointer" },
    5050
  • uspace/app/trace/ipcp.c

    r3feeab2 rff381a7  
    303303            (retval == 0)) {
    304304                /* Connected to a service (through NS) */
    305                 service = IPC_GET_ARG1(pcall->question);
     305                service = IPC_GET_ARG2(pcall->question);
    306306                proto = proto_get_by_srv(service);
    307307                if (proto == NULL)
  • uspace/app/trace/trace.c

    r3feeab2 rff381a7  
    5757#include "proto.h"
    5858#include <ipc/services.h>
    59 #include "../../srv/vfs/vfs.h"
     59#include <ipc/vfs.h>
    6060#include <ipc/console.h>
    6161
     
    528528        int fd_stderr;
    529529       
    530         if ((stdin != NULL) && (fhandle(stdin, &fd_stdin) == EOK))
     530        if ((stdin != NULL) && (vfs_fhandle(stdin, &fd_stdin) == EOK))
    531531                files[0] = &fd_stdin;
    532532        else
    533533                files[0] = NULL;
    534534       
    535         if ((stdout != NULL) && (fhandle(stdout, &fd_stdout) == EOK))
     535        if ((stdout != NULL) && (vfs_fhandle(stdout, &fd_stdout) == EOK))
    536536                files[1] = &fd_stdout;
    537537        else
    538538                files[1] = NULL;
    539539       
    540         if ((stderr != NULL) && (fhandle(stderr, &fd_stderr) == EOK))
     540        if ((stderr != NULL) && (vfs_fhandle(stderr, &fd_stderr) == EOK))
    541541                files[2] = &fd_stderr;
    542542        else
  • uspace/app/untar/main.c

    r3feeab2 rff381a7  
    103103static int handle_directory(const tar_header_t *header, FILE *tarfile)
    104104{
    105         int rc = mkdir(header->filename, 0755);
    106         if ((rc == EEXIST) || (rc == EEXISTS)) {
    107                 // printf("Note: directory %s already exists.\n", header->filename);
    108                 rc = EOK;
    109         }
    110         if (rc != EOK) {
    111                 fprintf(stderr, "Failed to create directory %s: %s.\n",
    112                     header->filename, str_error(rc));
    113                 return rc;
     105        if (mkdir(header->filename, 0755) != 0) {
     106                if (errno != EEXIST) {
     107                        fprintf(stderr, "Failed to create directory %s: %s.\n",
     108                            header->filename, str_error(errno));
     109                        return errno;
     110                }
    114111        }
    115112
  • uspace/app/viewer/viewer.c

    r3feeab2 rff381a7  
    9898{
    9999        int fd = open(fname, O_RDONLY);
    100         if (fd < 0)
     100        if (fd != 0)
    101101                return false;
    102102       
    103103        struct stat stat;
    104104        int rc = fstat(fd, &stat);
    105         if (rc != EOK) {
     105        if (rc != 0) {
    106106                close(fd);
    107107                return false;
     
    114114        }
    115115       
    116         ssize_t rd = read_all(fd, tga, stat.size);
     116        ssize_t rd = read(fd, tga, stat.size);
    117117        if ((rd < 0) || (rd != (ssize_t) stat.size)) {
    118118                free(tga);
  • uspace/app/vuhid/device.c

    r3feeab2 rff381a7  
    123123        /* Already used interface. */
    124124        if (iface->vuhid_data != NULL) {
    125                 return EEXISTS;
     125                return EEXIST;
    126126        }
    127127
  • uspace/app/wifi_supplicant/wifi_supplicant.c

    r3feeab2 rff381a7  
    121121       
    122122        async_sess_t *sess =
    123             loc_service_connect(EXCHANGE_SERIALIZE, wifis[i], 0);
     123            loc_service_connect(wifis[i], INTERFACE_DDF, 0);
    124124        if (sess == NULL) {
    125125                printf("Error connecting to service.\n");
Note: See TracChangeset for help on using the changeset viewer.