Pino Toscano
2015-Feb-12 18:50 UTC
Re: [Libguestfs] [PATCH] gnulib: Define argv[0] as program_name for error.c on Darwin
On Thursday 12 February 2015 17:39:45 Margaret Lewicka wrote:> --- > lib/error.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/lib/error.c b/lib/error.c > index 6683197..36a3db7 100644 > --- a/lib/error.c > +++ b/lib/error.c > @@ -113,9 +113,13 @@ int strerror_r (); > # endif > # endif > > +#if defined __APPLE__ && defined __MACH__ > +#define program_name (((char **)*_NSGetArgv())[0]) > +#else > /* The calling program should define program_name and set it to the > name of the executing program. */ > extern char *program_name; > +#endif > > # if HAVE_STRERROR_R || defined strerror_r > # define __strerror_r strerror_r >We import gnulib as git submodule from the upstream gnulib.git, so this should be sent to its mailing list; see also https://www.gnu.org/software/gnulib/ (Personally, I'm not sure that the above patch would help, but I'll leave the review to gnulib people on the right ml.) Thanks, -- Pino Toscano
Margaret Lewicka
2015-Feb-12 18:58 UTC
Re: [Libguestfs] [PATCH] gnulib: Define argv[0] as program_name for error.c on Darwin
On 12 February 2015 at 18:50, Pino Toscano <ptoscano@redhat.com> wrote: [...]> We import gnulib as git submodule from the upstream gnulib.git, so > this should be sent to its mailing list; see also > https://www.gnu.org/software/gnulib/ > > (Personally, I'm not sure that the above patch would help, but I'll > leave the review to gnulib people on the right ml.)This was requested by Richard in <20150211220126.GV11603@redhat.com>; the hack^Wsolution is his, I am merely providing the patch. (Would not send it myself because a) I believe libguestfs's executables should properly define the variable, rather than trying to circumvent the requirement, b) I don't have the knowledge to verify the solution past "it compiles and runs".) -- M.
Pino Toscano
2015-Feb-12 19:01 UTC
Re: [Libguestfs] [PATCH] gnulib: Define argv[0] as program_name for error.c on Darwin
On Thursday 12 February 2015 18:58:17 Margaret Lewicka wrote:> On 12 February 2015 at 18:50, Pino Toscano <ptoscano@redhat.com> wrote: > [...] > > We import gnulib as git submodule from the upstream gnulib.git, so > > this should be sent to its mailing list; see also > > https://www.gnu.org/software/gnulib/ > > > > (Personally, I'm not sure that the above patch would help, but I'll > > leave the review to gnulib people on the right ml.) > > This was requested by Richard in <20150211220126.GV11603@redhat.com>; > the hack^Wsolution is his, I am merely providing the patch. > > (Would not send it myself because a) I believe libguestfs's > executables should properly define the variable, rather than trying to > circumvent the requirement, b) I don't have the knowledge to verify > the solution past "it compiles and runs".)In any case, we cannot accept this patch, since it patches a file coming from an external repository. We just integrate gnulib in our workflow, using the modules of it which are needed for us (either to support quirks on different OSes, or to get some extra features). -- Pino Toscano
Maybe Matching Threads
- Re: [PATCH] gnulib: Define argv[0] as program_name for error.c on Darwin
- Re: [PATCH] gnulib: Define argv[0] as program_name for error.c on Darwin
- Re: [PATCH] gnulib: Define argv[0] as program_name for error.c on Darwin
- Re: [PATCH] gnulib: Define argv[0] as program_name for error.c on Darwin
- Re: [PATCH 2/5] macosx: Add definition of program_name for gnulib