qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/2] bridge helper: support conf dirs


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 1/2] bridge helper: support conf dirs
Date: Tue, 26 Feb 2013 17:05:11 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Feb 24, 2013 at 08:00:19PM -0600, Doug Goldstein wrote:
> @@ -84,6 +105,9 @@ static int parse_acl_file(const char *filename, ACLList 
> *acl_list)
>      while (fgets(line, sizeof(line), f) != NULL) {
>          char *ptr = line;
>          char *cmd, *arg, *argend;
> +        struct dirent **include_list = NULL;
> +        int i, include_count;
> +        char *conf_file;

These new variables could be declared...

>          while (isspace(*ptr)) {
>              ptr++;
> @@ -137,6 +161,37 @@ static int parse_acl_file(const char *filename, ACLList 
> *acl_list)
>                  snprintf(acl_rule->iface, IFNAMSIZ, "%s", arg);
>              }
>              QSIMPLEQ_INSERT_TAIL(acl_list, acl_rule, entry);
> +        } else if (strcmp(cmd, "includedir") == 0) {

...here in the scope where they are used.

> +            include_count = scandir(arg, &include_list,
> +                                    filter_bridge_conf_dir, NULL);

The POSIX scandir(3) spec and the Linux man page do not define what
happens when the compar argument is NULL.  You could use alphasort(3)
here to make behavior clear.



reply via email to

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