[PATCH] ifplugd: repeated setenv calls
Maksym Kryzhanovskyy
xmaks at email.cz
Fri May 7 08:00:41 UTC 2010
> What we can do is to use the sequence
>
> unsetenv(IFPLUGD_ENV_PREVIOUS);
> free(env_PREVIOUS);
> env_PREVIOUS = xasprintf(IFPLUGD_ENV_PREVIOUS"=%s",
> strstatus(G.iface_last_status));
> putenv(env_PREVIOUS);
>
> every time we want to set the variable to the new value.
> env_PREVIOUS is a global variable of type char*.
> This will work correctly with any libc.
>
> --
> vda
>
Hi Denis,
thanks for your reply. I wrote two alternatives to
apply this technique. Please consider their usage.
Max.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ifplugd.setenv1.patch
Type: text/x-patch
Size: 1228 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20100507/5fde47b3/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ifplugd.setenv2.patch
Type: text/x-patch
Size: 1502 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20100507/5fde47b3/attachment-0001.bin>
More information about the busybox
mailing list