aboutsummaryrefslogtreecommitdiffstats
path: root/net/cnet/files/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/cnet/files/compile.c')
-rw-r--r--net/cnet/files/compile.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/net/cnet/files/compile.c b/net/cnet/files/compile.c
index 8f3c4c2656e1..5f0405d14496 100644
--- a/net/cnet/files/compile.c
+++ b/net/cnet/files/compile.c
@@ -1,27 +1,25 @@
#include <dlfcn.h>
#include <nlist.h>
-static int add_compile_args(ac, av, kflag) int ac; char *av[]; int kflag;
+static int add_compile_args(int ac, char *av[], int kflag)
{
- av[ac++] = "-fPIC";
- av[ac++] = "-I/usr/local/include"; /* XXX GROSS - should use prefix */
+ av[ac++] = "-fPIC";
return(ac);
}
-static int add_link_args(ac, av, kflag) int ac; char *av[]; int kflag;
+static int add_link_args(int ac, char *av[], int kflag)
{
av[ac++] = findenv("CNETLD", CNETLD);
- av[ac++] = "cc";
- av[ac++] = "-Bshareable";
+ av[ac++] = "ld";
+ av[ac++] = "-shared";
return(ac);
}
-static void data_segments(n, handle, so_filenm)
- int n; void *handle; char *so_filenm;
+static void data_segments(int n, void *handle, char *so_filenm)
{
- extern int nlist _PARAMS((const char *, struct nlist *));
+ extern int nlist(const char *, struct nlist *);
typedef struct _c {
char *so_filenm;
@@ -48,8 +46,8 @@ static void data_segments(n, handle, so_filenm)
nls[2].n_name = (char *)NULL;
if(nlist(so_filenm, nls) != 0) {
- (void)fprintf(stderr,"%s: cannot load symbols from %s\n",
- progname,so_filenm);
+ fprintf(stderr,"%s: cannot load symbols from %s\n",
+ argv0,so_filenm);
++nerrors;
return;
}
@@ -59,12 +57,12 @@ static void data_segments(n, handle, so_filenm)
cp->length_data = (nls[1].n_value - nls[0].n_value);
cp->incore_data = (char *)((long)dlsym(handle,"end") - cp->length_data);
cp->original_data = (char *)malloc(cp->length_data);
- (void)memcpy(cp->original_data, cp->incore_data, cp->length_data);
+ memcpy(cp->original_data, cp->incore_data, cp->length_data);
cp->next = chd;
chd = cp;
if(vflag)
- (void)fprintf(stderr,"%s dataseg=0x%08lx len(dataseg)=%ld\n",
+ fprintf(stderr,"%s dataseg=0x%08lx len(dataseg)=%ld\n",
so_filenm, (long)cp->incore_data, cp->length_data);
found:
@@ -73,5 +71,5 @@ found:
np->original_data[0] = cp->original_data;
np->private_data[0] = (char *)malloc(cp->length_data);
- (void)memcpy(np->private_data[0], cp->original_data, cp->length_data);
+ memcpy(np->private_data[0], cp->original_data, cp->length_data);
}