Hi, The following diff makes `struct execsw' to:
- use C99-style initialization (grep works better with that) - use const as execsw is not modified during runtime Comments or OK ? -- Sebastien Marie diff 2533c50dc3c36fe283749b7fcaef52891806c13c /home/semarie/repos/openbsd/src blob - 43b0ebb9c128d7352b7b74119d3ea315654e03d2 file + sys/kern/exec_conf.c --- sys/kern/exec_conf.c +++ sys/kern/exec_conf.c @@ -38,9 +38,15 @@ extern struct emul emul_native; -struct execsw execsw[] = { - { EXEC_SCRIPT_HDRSZ, exec_script_makecmds }, /* shell scripts */ - { sizeof(Elf_Ehdr), exec_elf_makecmds }, /* elf binaries */ +const struct execsw execsw[] = { + { /* shell scripts */ + .es_hdrsz = EXEC_SCRIPT_HDRSZ, + .es_check = exec_script_makecmds, + }, + { /* elf binaries */ + .es_hdrsz = sizeof(Elf_Ehdr), + .es_check = exec_elf_makecmds, + }, }; int nexecs = (sizeof execsw / sizeof(*execsw)); int exec_maxhdrsz; blob - 5158eb25e5c720731deb9bdd04b65f8525140c49 file + sys/sys/exec.h --- sys/sys/exec.h +++ sys/sys/exec.h @@ -212,7 +212,7 @@ void new_vmcmd(struct exec_vmcmd_set *evsp, * Functions for specific exec types should be defined in their own * header file. */ -extern struct execsw execsw[]; +extern const struct execsw execsw[]; extern int nexecs; extern int exec_maxhdrsz;