Re: getprogname() for IBM z/OS

2016-10-12 Thread Daniel Richard G.
On Wed, 2016 Oct 12 11:04+0100, Pádraig Brady wrote: > > You only want to strdup once. > So you could use a static to track that as is done in the AIX case. Ah, I see, the program name never changes. > You can call free(NULL), so the last 3 ifs are redundant. Revised patch is tested and attache

Re: 2 patches: long-options.c vs -Wimplicit-fallthrough and .m4 nits

2016-10-12 Thread Paul Eggert
On 10/12/2016 03:06 PM, Jim Meyering wrote: Sure. Update past this commit: Thanks, that fixed it for me.

Re: 2 patches: long-options.c vs -Wimplicit-fallthrough and .m4 nits

2016-10-12 Thread Jim Meyering
On Wed, Oct 12, 2016 at 9:45 AM, Paul Eggert wrote: > That email (archived at > ) is > missing the one-line change that was installed into lib/long-options.c. > Maybe a problem in the way that you invoked vc-dwim? PEBKAC :-) > W

Re: 2 patches: long-options.c vs -Wimplicit-fallthrough and .m4 nits

2016-10-12 Thread Paul Eggert
That email (archived at ) is missing the one-line change that was installed into lib/long-options.c. Maybe a problem in the way that you invoked vc-dwim? While we're on the topic of vc-dwim, every time I use vc-dwim I get the

Re: getprogname() for IBM z/OS

2016-10-12 Thread Pádraig Brady
On 12/10/16 09:51, Daniel Richard G. wrote: > +#elif __MVS__ > + /* > https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxbd00/rtwgetp.htm > */ > + char *p = "?"; > + pid_t pid = getpid (); > + int token; > + W_PSPROC buf; > + memset (&buf, 0, sizeof(buf)); > + buf

getprogname() for IBM z/OS

2016-10-12 Thread Daniel Richard G.
Please double-check the use of strdup(), to avoid memory leakage. 2016-10-12 Daniel Richard G. getprogname: port to IBM z/OS * lib/getprogname.c (getprogname) [__MVS__]: Use getpid, w_getpsent and strdup to obtain the program name string. --Daniel -- Daniel Richard