summaryrefslogtreecommitdiffstats
path: root/sys/kern/imgact_elf.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-07-09 19:10:14 +0000
committerpeter <peter@FreeBSD.org>1999-07-09 19:10:14 +0000
commit2224047f76565456b13449a960a30720ca95a308 (patch)
tree75bf0c3351d0ab03b8024eacf27c1e83090924ad /sys/kern/imgact_elf.c
parent2a94fa3ede8301b6582a05f8abc21633a9d1ec5d (diff)
downloadFreeBSD-src-2224047f76565456b13449a960a30720ca95a308.zip
FreeBSD-src-2224047f76565456b13449a960a30720ca95a308.tar.gz
Fix the previous warning a different way since the emul_path exposure was
intentional. Avoid the warning by propagating the const filename through to elf_load_file() instead.
Diffstat (limited to 'sys/kern/imgact_elf.c')
-rw-r--r--sys/kern/imgact_elf.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 1e7ab63..36ade48 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: imgact_elf.c,v 1.59 1999/07/05 18:38:29 marcel Exp $
+ * $Id: imgact_elf.c,v 1.60 1999/07/09 18:05:03 peter Exp $
*/
#include "opt_rlimit.h"
@@ -72,7 +72,7 @@ __ElfType(Auxargs);
static int elf_check_header __P((const Elf_Ehdr *hdr));
static int elf_freebsd_fixup __P((long **stack_base,
struct image_params *imgp));
-static int elf_load_file __P((struct proc *p, char *file, u_long *addr,
+static int elf_load_file __P((struct proc *p, const char *file, u_long *addr,
u_long *entry));
static int elf_load_section __P((struct proc *p,
struct vmspace *vmspace, struct vnode *vp,
@@ -297,7 +297,7 @@ elf_load_section(struct proc *p, struct vmspace *vmspace, struct vnode *vp, vm_o
* the entry point for the loaded file.
*/
static int
-elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
+elf_load_file(struct proc *p, const char *file, u_long *addr, u_long *entry)
{
const Elf_Ehdr *hdr = NULL;
const Elf_Phdr *phdr = NULL;
@@ -588,11 +588,9 @@ exec_elf_imgact(struct image_params *imgp)
brand_info->emul_path, interp);
if ((error = elf_load_file(imgp->proc, path, &addr,
&imgp->entry_addr)) != 0) {
- snprintf(path, sizeof(path), "%s", interp);
- if ((error = elf_load_file(imgp->proc, path, &addr,
+ if ((error = elf_load_file(imgp->proc, interp, &addr,
&imgp->entry_addr)) != 0) {
- uprintf("ELF interpreter %s not found\n",
- path);
+ uprintf("ELF interpreter %s not found\n", path);
goto fail;
}
}
OpenPOWER on IntegriCloud