summaryrefslogtreecommitdiffstats
path: root/sbin/modload/modload.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/modload/modload.c')
-rw-r--r--sbin/modload/modload.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sbin/modload/modload.c b/sbin/modload/modload.c
index 0efd0ea..96cb837 100644
--- a/sbin/modload/modload.c
+++ b/sbin/modload/modload.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: modload.c,v 1.7 1995/03/16 17:11:21 wollman Exp $
+ * $Id: modload.c,v 1.8 1995/05/30 06:09:20 rgrimes Exp $
*/
#include <stdio.h>
@@ -51,10 +51,6 @@
#include <sys/signal.h>
#include "pathnames.h"
-#ifndef DFLT_ENTRY
-#define DFLT_ENTRY "xxxinit"
-#endif /* !DFLT_ENTRY */
-
#define min(a, b) ((a) < (b) ? (a) : (b))
int debug = 0;
@@ -164,7 +160,7 @@ main(argc, argv)
{
int c;
char *kname = (char *)getbootfile();
- char *entry = DFLT_ENTRY;
+ char *entry = NULL;
char *post = NULL;
char *out = NULL;
char *modobj;
@@ -218,6 +214,16 @@ main(argc, argv)
modobj = argv[0];
+ if (!entry) { /* calculate default entry point */
+ entry = strrchr(modobj, '/');
+ if (entry)
+ entry++; /* skip over '/' */
+ else
+ entry = modobj;
+ entry = strdup(entry); /* so we can modify it */
+ entry[strlen(entry) - 2] = '\0'; /* chop off .o */
+ }
+
atexit(cleanup);
/*
OpenPOWER on IntegriCloud