Don't bother copying the name of a kproc or kthread out into a temporary
array just to pass that array to printf(). kproc and kthread names are NUL-terminated and can be printed using printf() directly. Reviewed by: bde
This commit is contained in:
parent
90759b0021
commit
4f9d48e478
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=198408
@ -618,16 +618,14 @@ void
|
||||
kproc_shutdown(void *arg, int howto)
|
||||
{
|
||||
struct proc *p;
|
||||
char procname[MAXCOMLEN + 1];
|
||||
int error;
|
||||
|
||||
if (panicstr)
|
||||
return;
|
||||
|
||||
p = (struct proc *)arg;
|
||||
strlcpy(procname, p->p_comm, sizeof(procname));
|
||||
printf("Waiting (max %d seconds) for system process `%s' to stop...",
|
||||
kproc_shutdown_wait, procname);
|
||||
kproc_shutdown_wait, p->p_comm);
|
||||
error = kproc_suspend(p, kproc_shutdown_wait * hz);
|
||||
|
||||
if (error == EWOULDBLOCK)
|
||||
@ -640,16 +638,14 @@ void
|
||||
kthread_shutdown(void *arg, int howto)
|
||||
{
|
||||
struct thread *td;
|
||||
char procname[MAXCOMLEN + 1];
|
||||
int error;
|
||||
|
||||
if (panicstr)
|
||||
return;
|
||||
|
||||
td = (struct thread *)arg;
|
||||
strlcpy(procname, td->td_name, sizeof(procname));
|
||||
printf("Waiting (max %d seconds) for system thread `%s' to stop...",
|
||||
kproc_shutdown_wait, procname);
|
||||
kproc_shutdown_wait, td->td_name);
|
||||
error = kthread_suspend(td, kproc_shutdown_wait * hz);
|
||||
|
||||
if (error == EWOULDBLOCK)
|
||||
|
Loading…
Reference in New Issue
Block a user