mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 17:59:07 -04:00
47 lines
1.4 KiB
Plaintext
47 lines
1.4 KiB
Plaintext
$NetBSD: patch-af,v 1.3 2005/10/13 03:31:06 ben Exp $
|
|
|
|
--- src/execl.c.orig 1999-07-28 14:46:58.000000000 -0700
|
|
+++ src/execl.c
|
|
@@ -22,6 +22,7 @@
|
|
*/
|
|
char SCCSid[] = "@(#) @(#)execl.c:3.3 -- 5/15/91 19:30:19";
|
|
|
|
+#include <limits.h>
|
|
#include <stdio.h>
|
|
#include <sys/types.h>
|
|
|
|
@@ -45,8 +46,9 @@ char *argv[];
|
|
char *ptr;
|
|
char *fullpath;
|
|
int duration;
|
|
- char count_str[6], start_str[12], path_str[81], *dur_str;
|
|
+ char count_str[6], start_str[12], path_str[PATH_MAX], *dur_str;
|
|
time_t start_time, this_time;
|
|
+ unsigned long ul_time;
|
|
|
|
#ifdef DEBUG
|
|
int count;
|
|
@@ -77,18 +79,19 @@ char *argv[];
|
|
duration = atoi(argv[2]);
|
|
dur_str = argv[2];
|
|
iter = (unsigned long)atoi(argv[3]); /* where are we now ? */
|
|
- sscanf(argv[4], "%lu", &start_time);
|
|
+ sscanf(argv[4], "%lu", &ul_time);
|
|
+ start_time = ul_time;
|
|
fullpath = argv[0];
|
|
}
|
|
|
|
sprintf(count_str, "%lu", ++iter); /* increment the execl counter */
|
|
- sprintf(start_str, "%lu", start_time);
|
|
+ sprintf(start_str, "%lu", (unsigned long) start_time);
|
|
time(&this_time);
|
|
if (this_time - start_time >= duration) { /* time has run out */
|
|
fprintf(stderr, "%lu loops\n", iter);
|
|
exit(0);
|
|
}
|
|
- execl(fullpath, fullpath, "0", dur_str, count_str, start_str, 0);
|
|
+ execl(fullpath, fullpath, "0", dur_str, count_str, start_str, NULL);
|
|
printf("Exec failed at iteration %lu\n", iter);
|
|
perror("Reason");
|
|
exit(1);
|