From b33f91e91da81059b388c8f8ee0d0024212eb180 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 10 Oct 1996 01:07:18 +0000 Subject: update from main archive 961009 Wed Oct 9 00:24:52 1996 Jim Meyering * time/strftime.c: Allow old K&R compilers compile this file. Wed Oct 9 12:03:56 1996 Ulrich Drepper * posix/execlp.c: Add first argument parameter to be compliant with POSIX. Rearrange body to start vararg counter after this new argument. Wed Oct 9 04:34:50 1996 Ulrich Drepper * sysdeps/unix/sysv/linux/sys/procfs.h: Rewrite. We cannot use simply a wrapper around the file since the kernel header is not clean enough. We provide the definitions in this file instead. Wed Oct 9 01:43:18 1996 Ulrich Drepper * sysdeps/unix/sysv/linux/gethostid.c (sethostid): Avoid get?id calls by using __libc_enable_secure. --- posix/execlp.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'posix') diff --git a/posix/execlp.c b/posix/execlp.c index af09dacafd..f442c05d94 100644 --- a/posix/execlp.c +++ b/posix/execlp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include #include #include #include @@ -25,20 +24,19 @@ Cambridge, MA 02139, USA. */ it contains no slashes, with all arguments after FILE until a NULL pointer and environment from `environ'. */ int -DEFUN(execlp, (file), CONST char *file DOTS) +execlp (const char *file, const char *arg, ...) { - CONST char *argv[1024]; - register unsigned int i; + const char *argv[1024]; + unsigned int i; va_list args; - va_start (args, file); + va_start (args, arg); - i = 0; - do - argv[i] = va_arg (args, CONST char *); - while (argv[i++] != NULL); + argv[i = 0] = arg; + while (argv[i++] != NULL) + argv[i] = va_arg (args, const char *); va_end (args); - return execvp (file, (char *CONST *) argv); + return execvp (file, (char *const *) argv); } -- cgit 1.4.1