diff options
Diffstat (limited to 'usr/src/lib/libproc/common/Psyscall.c')
-rw-r--r-- | usr/src/lib/libproc/common/Psyscall.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr/src/lib/libproc/common/Psyscall.c b/usr/src/lib/libproc/common/Psyscall.c index c34a17a04c..1261eb49b4 100644 --- a/usr/src/lib/libproc/common/Psyscall.c +++ b/usr/src/lib/libproc/common/Psyscall.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -80,7 +79,7 @@ int Pcreate_agent(struct ps_prochandle *P) { int fd; - char pathname[100]; + char pathname[PATH_MAX]; char *fname; struct { long cmd; @@ -123,7 +122,8 @@ Pcreate_agent(struct ps_prochandle *P) (void) Pstopstatus(P, PCNULL, 0); /* open the agent LWP files */ - (void) sprintf(pathname, "/proc/%d/lwp/agent/", (int)P->pid); + (void) snprintf(pathname, sizeof (pathname), "%s/%d/lwp/agent/", + procfs_path, (int)P->pid); fname = pathname + strlen(pathname); (void) set_minfd(); |