Hi,
On Mon, Dec 3, 2018 at 12:54 PM Ladislav Michl <
address@hidden> wrote:
>
> posix_spawn specification dates back to last century and its
> implementation is mature enough in all systems we do support.
> Thus use it instead of current fork and exec in hope it will
> save us some resources.
There is more than this in this patch. Would you mind in splitting it into two or more parts? A large portion of the patch is related to reorganizing the code. Two examples below.
Cheers,
Paweł
> diff --git a/include/gnokii-internal.h b/include/gnokii-internal.h
> index c4f6d625..9af2d8cc 100644
> --- a/include/gnokii-internal.h
> +++ b/include/gnokii-internal.h
> @@ -20,6 +20,7 @@
> #ifndef _gnokii_internal_h
> #define _gnokii_internal_h
>
> +#include "cfgreader.h"
I think I was trying to avoid that for a long time. Not sure now about the reasoning.
> -typedef void (*cfg_foreach_func)(const char *section, const char *key, const char *value);
> -void cfg_foreach(const char *section, cfg_foreach_func func);
> +#define cfg_foreach_entry(section, header, entry) \
> + for (; header != NULL; header = header->next) \
> + if (strcmp(section, h->section) == 0) \
> + for (entry = h->entries; entry != NULL; entry = entry->next)
Why that?
Cheers
Paweł
--
Pawel Kot