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

Re: [Xen-devel] [PATCH v4 1/4] libxl: pass env vars to libxl__exec



Roger Pau Monne writes ("[Xen-devel] [PATCH v4 1/4] libxl: pass env vars to 
libxl__exec"):
> +            if (setenv(env[i], env[i+1], 1) < 0) {
> +                switch (errno) {
> +                case EINVAL:
> +                    LOGEV(ERROR, errno, "invalid env variables (%s = %s)",
> +                                        env[i], env[i+1]);
> +                    break;
> +                case ENOMEM:
> +                    libxl__alloc_failed(CTX, __func__, 0, 0);
> +                }
> +                goto out;

This silently exits if errno isn't one of the expected values.

TBH I'm not sure you need to bother switching on errno here.  Whatever
the errno is we're going to log a message and exit nonzero, so you
might as well simply LOGEV even in the ENOMEM case.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.