Page MenuHomeFreeBSD

D26363.diff
No OneTemporary

D26363.diff

Index: head/usr.sbin/crunch/crunchgen/crunched_main.c
===================================================================
--- head/usr.sbin/crunch/crunchgen/crunched_main.c
+++ head/usr.sbin/crunch/crunchgen/crunched_main.c
@@ -76,15 +76,19 @@
#include <stdlib.h>
#include <string.h>
+typedef int crunched_stub_t(int, char **, char **);
+
struct stub {
- char *name;
- int (*f)();
+ const char *name;
+ crunched_stub_t *f;
};
extern const char *__progname;
extern struct stub entry_points[];
static void crunched_usage(void);
+
+crunched_stub_t crunched_main;
static struct stub *
find_entry_point(const char *basename)
Index: head/usr.sbin/crunch/crunchgen/crunchgen.c
===================================================================
--- head/usr.sbin/crunch/crunchgen/crunchgen.c
+++ head/usr.sbin/crunch/crunchgen/crunchgen.c
@@ -934,7 +934,9 @@
fprintf(outcf, "%s\n", *cp);
for (p = progs; p != NULL; p = p->next)
- fprintf(outcf, "extern int _crunched_%s_stub();\n", p->ident);
+ fprintf(outcf,
+ "extern crunched_stub_t _crunched_%s_stub;\n",
+ p->ident);
fprintf(outcf, "\nstruct stub entry_points[] = {\n");
for (p = progs; p != NULL; p = p->next) {
@@ -1122,9 +1124,10 @@
fprintf(outmk, "%s_stub.c:\n", p->name);
fprintf(outmk, "\techo \""
"extern int main(int argc, char **argv, char **envp); "
+ "int _crunched_%s_stub(int argc, char **argv, char **envp);"
"int _crunched_%s_stub(int argc, char **argv, char **envp)"
"{return main(argc,argv,envp);}\" >%s_stub.c\n",
- p->ident, p->name);
+ p->ident, p->ident, p->name);
fprintf(outmk, "%s.lo: %s_stub.o $(%s_OBJPATHS)",
p->name, p->name, p->ident);
if (p->libs)

File Metadata

Mime Type
text/plain
Expires
Wed, Jan 22, 4:20 AM (20 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16024763
Default Alt Text
D26363.diff (1 KB)

Event Timeline