bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH libpciaccess] hurd: device_open the pre-existing pci server


From: Samuel Thibault
Subject: Re: [PATCH libpciaccess] hurd: device_open the pre-existing pci server
Date: Sat, 6 Mar 2021 23:46:54 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Damien Zammit, le dim. 07 mars 2021 09:36:26 +1100, a ecrit:
>              devices = realloc(pci_sys->devices, (pci_sys->num_devices + 1)
>                                * sizeof(struct pci_device_private));
>              if (!devices) {
> -                if (closedir(dir) < 0)
> -                    return errno;
>                  return ENOMEM;
>              }

Missing mach_port_deallocate (mach_task_self (), device_port);
?

> @@ -489,6 +508,11 @@ pci_system_hurd_create(void)
>  {
>      int err;
>      struct pci_system_hurd *pci_sys_hurd;
> +    mach_port_t device_master;
> +    mach_port_t root = MACH_PORT_NULL;
> +    const char *sbpci = _SERVERS_BUS_PCI;
> +    const char *dot = ".";
> +    char *rootpath = (char *)dot;

Why not making rootpath a const char *? That'll avoid all the casts (and
I would rather not use the dot and sbpci variables, and just directly
initialize root path to "." and below set it to _SERVERS_BUS_PCI).

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]