On Thu, 2013-09-19 at 12:42 +0200, Pino Toscano wrote: > Hi, > > In data giovedì 19 settembre 2013 12:16:49, Svante Signell ha scritto: > > The patch is attached. Additionally, the freebsd patch is modified to > > include errno.h for definition of ENODATA and EPIPE. The compiler > > complains that EPIPE is not defined otherwise. Maybe this file can be > > included unconditionally, without harm. I wonder how the error codes > > are defined for freebsd if errno.h is not included? > > Reviews below. > > Storing statically the result of getenv is wrong, since it points to the > global environment array which can be reallocated anytime.
A solution would be to remove the static keyword then. > Also, no need to rename envp to home, makes the change bigger for no > reason. Agreed! > Furthermore, your changes are losing the check for an empty HOME. I don't think so, in that case getenv returns NULL > A better change is the following, which is easier: I thought of doing something like that, but did not. You beat me to it, thanks! > No need to misuse __GNU__ for this, errno.h is a standard and such it > can be included anytime. In case it poses issues on Windows (sigh), you > can include it in the else of the _WIN32 block (as people in -bsd@ > suggested regarding fcntl.h). See my comment above! The errno.h inclusion place was under discussion. > > #ifdef _WIN32 > > #include <windef.h> > > #include <winbase.h> > > @@ -50,6 +54,11 @@ > > #define geteuid() 0 > > #endif > > > > +#ifndef ENODATA > > +#define ENODATA EPIPE > > +#endif > > This may be problematic. c_copy in src/std/c_file.c uses ENODATA as > errno in a couple of error situations, but since c_copy is an exported > symbol (although its header is not installed), users of this function > would need to do this ENODATA→EPIPE mapping themselves too. This is not part of my patch. Address this to upstream/debian maintainer directly. -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected] Archive: http://lists.debian.org/[email protected]

