Skip to content

Commit

Permalink
OS-4277 lx procfs /proc/{pid}/environ always empty [handle empty env …
Browse files Browse the repository at this point in the history
…vector]
  • Loading branch information
jjelinek committed May 7, 2015
1 parent 734281d commit 42a9be3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions usr/src/uts/common/fs/proc/prargv.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,14 @@ prreadenvv(proc_t *p, char *buf, size_t bufsz, size_t *slen)
if (tmp == NULL)
break;
}
if (cnt == 0) {
/* Return empty string. */
buf[0] = '\0';
*slen = 1;
mutex_enter(&p->p_lock);
VERIFY(p->p_proc_flag & P_PR_LOCK);
return (0);
}

/*
* Allocate space to store env array.
Expand Down

0 comments on commit 42a9be3

Please sign in to comment.