Increase pidstr size to 10 chars.
This commit is contained in:
parent
5d38d4d6e9
commit
143239e143
@ -954,7 +954,7 @@ int main(int argc, char **argv)
|
|||||||
bool going_down = false;
|
bool going_down = false;
|
||||||
int depoptions = RC_DEP_STRICT | RC_DEP_TRACE;
|
int depoptions = RC_DEP_STRICT | RC_DEP_TRACE;
|
||||||
char krunlevel [PATH_MAX];
|
char krunlevel [PATH_MAX];
|
||||||
char pidstr[6];
|
char pidstr[10];
|
||||||
int opt;
|
int opt;
|
||||||
bool parallel;
|
bool parallel;
|
||||||
int regen = 0;
|
int regen = 0;
|
||||||
|
@ -1084,7 +1084,7 @@ int runscript(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
bool deps = true;
|
bool deps = true;
|
||||||
bool doneone = false;
|
bool doneone = false;
|
||||||
char pid[16];
|
char pidstr[10];
|
||||||
int retval;
|
int retval;
|
||||||
int opt;
|
int opt;
|
||||||
RC_STRING *svc;
|
RC_STRING *svc;
|
||||||
@ -1143,8 +1143,8 @@ int runscript(int argc, char **argv)
|
|||||||
/* Set an env var so that we always know our pid regardless of any
|
/* Set an env var so that we always know our pid regardless of any
|
||||||
subshells the init script may create so that our mark_service_*
|
subshells the init script may create so that our mark_service_*
|
||||||
functions can always instruct us of this change */
|
functions can always instruct us of this change */
|
||||||
snprintf(pid, sizeof(pid), "%d", (int) getpid());
|
snprintf(pidstr, sizeof(pidstr), "%d", (int) getpid());
|
||||||
setenv("RC_RUNSCRIPT_PID", pid, 1);
|
setenv("RC_RUNSCRIPT_PID", pidstr, 1);
|
||||||
|
|
||||||
/* eprefix is kinda klunky, but it works for our purposes */
|
/* eprefix is kinda klunky, but it works for our purposes */
|
||||||
if (rc_conf_yesno("rc_parallel")) {
|
if (rc_conf_yesno("rc_parallel")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user