From 0aaf677efbf70fd173d241c01632b4eacc8226e5 Mon Sep 17 00:00:00 2001 From: fche Date: Fri, 19 Aug 2005 15:55:39 +0000 Subject: 2005-08-19 Frank Ch. Eigler * librelay.c (modpath): New global. Use it for insmod only. * stpd.c (main): Set both modpath and modname, to support modules specified by full path name. --- runtime/stpd/stpd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'runtime/stpd/stpd.c') diff --git a/runtime/stpd/stpd.c b/runtime/stpd/stpd.c index db0f328e..0a4cf57a 100644 --- a/runtime/stpd/stpd.c +++ b/runtime/stpd/stpd.c @@ -37,6 +37,7 @@ int merge = 1; int verbose = 0; unsigned int buffer_size = 0; char *modname = NULL; +char *modpath = NULL; /* relayfs base file name */ static char stpd_filebase[1024]; @@ -104,7 +105,15 @@ int main(int argc, char **argv) } if (optind < argc) - modname = argv[optind++]; + { + /* Collect both full path and just the trailing module name. */ + modpath = argv[optind++]; + modname = rindex (modpath, '/'); + if (modname == NULL) + modname = modpath; + else + modname++; /* skip over / */ + } if (!modname) { fprintf (stderr, "Cannot invoke daemon without probe module\n"); -- cgit