Changeset b6061f8c in mainline for uspace


Ignore:
Timestamp:
2025-04-14T14:18:50Z (11 months ago)
Author:
GitHub <noreply@…>
Children:
f444633
Parents:
c7c6afd (diff), 5d2bdaa (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.
git-author:
Wayne Thornton <wmthornton-dev@…> (2025-04-14 14:18:50)
git-committer:
GitHub <noreply@…> (2025-04-14 14:18:50)
Message:

Merge branch 'HelenOS:master' into master

Location:
uspace
Files:
5 edited

Legend:

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

    rc7c6afd rb6061f8c  
    7272 */
    7373#define DEFAULT_DEV_0 "devices/\\hw\\sys\\00:01.1\\c0d0"
    74 #define DEFAULT_DEV_1 "devices/\\hw\\sys\\00:01.0\\ide1\\c0d0"
     74#define DEFAULT_DEV_1 "devices/\\hw\\sys\\ide1\\c0d0"
    7575//#define DEFAULT_DEV "devices/\\hw\\pci0\\00:01.2\\uhci_rh\\usb01_a1\\mass-storage0\\l0"
    7676/** Volume label for the new file system */
  • uspace/drv/block/isa-ide/main.c

    rc7c6afd rb6061f8c  
    169169        isa_ide_ctrl_t *ctrl;
    170170        isa_ide_hwres_t res;
     171        unsigned chans;
    171172        errno_t rc;
    172173
     
    187188        ctrl->dev = dev;
    188189
     190        chans = 0;
     191
    189192        rc = isa_ide_channel_init(ctrl, &ctrl->channel[0], 0, &res);
    190         if (rc == ENOENT)
     193        if (rc == EOK)
     194                ++chans;
     195        else if (rc != ENOENT)
    191196                goto error;
    192197
    193198        rc = isa_ide_channel_init(ctrl, &ctrl->channel[1], 1, &res);
    194         if (rc == ENOENT)
    195                 goto error;
    196 
    197         if (rc != EOK) {
    198                 ddf_msg(LVL_ERROR, "Failed initializing ATA controller.");
     199        if (rc == EOK)
     200                ++chans;
     201        else if (rc != ENOENT)
     202                goto error;
     203
     204        if (chans == 0) {
     205                ddf_msg(LVL_ERROR, "No ISA IDE devices found.");
    199206                rc = EIO;
    200207                goto error;
  • uspace/drv/block/pci-ide/main.c

    rc7c6afd rb6061f8c  
    136136        pci_ide_hwres_t res;
    137137        async_sess_t *parent_sess;
     138        unsigned chans;
    138139        errno_t rc;
    139140
     
    157158                goto error;
    158159
     160        chans = 0;
     161
    159162        rc = pci_ide_channel_init(ctrl, &ctrl->channel[0], 0, &res);
    160         if (rc == ENOENT)
     163        if (rc == EOK)
     164                ++chans;
     165        else if (rc != ENOENT)
    161166                goto error;
    162167
    163168        rc = pci_ide_channel_init(ctrl, &ctrl->channel[1], 1, &res);
    164         if (rc == ENOENT)
    165                 goto error;
    166 
    167         if (rc != EOK) {
    168                 ddf_msg(LVL_ERROR, "Failed initializing ATA controller.");
     169        if (rc == EOK)
     170                ++chans;
     171        else if (rc != ENOENT)
     172                goto error;
     173
     174        if (chans == 0) {
     175                ddf_msg(LVL_ERROR, "No PCI IDE devices found.");
    169176                rc = EIO;
    170177                goto error;
  • uspace/lib/c/test/adt/odict.c

    rc7c6afd rb6061f8c  
    233233
    234234                e->key = v;
    235                 odict_insert(&e->odict, &odict, &ep->odict);
     235                odict_insert(&e->odict, &odict, ep ? &ep->odict : NULL);
    236236                PCUT_ASSERT_ERRNO_VAL(EOK, odict_validate(&odict));
    237237                v = seq_next(v);
  • uspace/lib/c/test/str.c

    rc7c6afd rb6061f8c  
    2727 */
    2828
     29#include "pcut/asserts.h"
    2930#include <stdio.h>
    3031#include <str.h>
     
    115116}
    116117
     118PCUT_TEST(str_non_shortest)
     119{
     120        /* Overlong zero. */
     121        const char overlong1[] = { 0b11000000, 0b10000000, 0 };
     122        const char overlong2[] = { 0b11100000, 0b10000000, 0 };
     123        const char overlong3[] = { 0b11110000, 0b10000000, 0 };
     124
     125        const char overlong4[] = { 0b11000001, 0b10111111, 0 };
     126        const char overlong5[] = { 0b11100000, 0b10011111, 0b10111111, 0 };
     127        const char overlong6[] = { 0b11110000, 0b10001111, 0b10111111, 0b10111111, 0 };
     128
     129        size_t offset = 0;
     130        PCUT_ASSERT_INT_EQUALS(U_SPECIAL, str_decode(overlong1, &offset, sizeof(overlong1)));
     131        offset = 0;
     132        PCUT_ASSERT_INT_EQUALS(U_SPECIAL, str_decode(overlong2, &offset, sizeof(overlong2)));
     133        offset = 0;
     134        PCUT_ASSERT_INT_EQUALS(U_SPECIAL, str_decode(overlong3, &offset, sizeof(overlong3)));
     135        offset = 0;
     136        PCUT_ASSERT_INT_EQUALS(U_SPECIAL, str_decode(overlong4, &offset, sizeof(overlong4)));
     137        offset = 0;
     138        PCUT_ASSERT_INT_EQUALS(U_SPECIAL, str_decode(overlong5, &offset, sizeof(overlong5)));
     139        offset = 0;
     140        PCUT_ASSERT_INT_EQUALS(U_SPECIAL, str_decode(overlong6, &offset, sizeof(overlong6)));
     141
     142        char sanitized[sizeof(overlong6)];
     143        str_cpy(sanitized, STR_NO_LIMIT, overlong1);
     144        PCUT_ASSERT_INT_EQUALS(U_SPECIAL, sanitized[0]);
     145        str_cpy(sanitized, STR_NO_LIMIT, overlong2);
     146        PCUT_ASSERT_INT_EQUALS(U_SPECIAL, sanitized[0]);
     147        str_cpy(sanitized, STR_NO_LIMIT, overlong3);
     148        PCUT_ASSERT_INT_EQUALS(U_SPECIAL, sanitized[0]);
     149        str_cpy(sanitized, STR_NO_LIMIT, overlong4);
     150        PCUT_ASSERT_INT_EQUALS(U_SPECIAL, sanitized[0]);
     151        str_cpy(sanitized, STR_NO_LIMIT, overlong5);
     152        PCUT_ASSERT_INT_EQUALS(U_SPECIAL, sanitized[0]);
     153        str_cpy(sanitized, STR_NO_LIMIT, overlong6);
     154        PCUT_ASSERT_INT_EQUALS(U_SPECIAL, sanitized[0]);
     155}
     156
    117157PCUT_EXPORT(str);
Note: See TracChangeset for help on using the changeset viewer.