On Thu, Oct 13, 2016 at 1:10 PM, Jim Meyering wrote:
> On Thu, Oct 13, 2016 at 1:50 AM, Pádraig Brady wrote:
>> On 13/10/16 02:43, Daniel Richard G. wrote:
>>> 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
On Thu, Oct 13, 2016 at 1:50 AM, Pádraig Brady wrote:
> On 13/10/16 02:43, Daniel Richard G. wrote:
>> 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 nam
On 13/10/16 02:43, Daniel Richard G. wrote:
> 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
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
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
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