|
|
http://perforce.freebsd.org/chv.cgi?CH=100750
Change 100750 by piso@piso_newluxor on 2006/07/06 13:38:32
Better return code.
Affected files ...
.. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#6 edit
Differences ...
==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#6 (text+ko)
====
@@ -1523,18 +1523,16 @@
const char *error;
moduledata_t *p;
- // XXX - mixing my own error code and errno.h is really
- // a bad idea, convert everything to use errno.h
handle = dlopen (path, RTLD_LAZY);
if (!handle) {
fputs (dlerror(), stderr);
- return (-1);
+ return (EINVAL);
}
p = dlsym(handle, "alias_mod");
if ((error = dlerror()) != NULL) {
fputs(error, stderr);
- return (-1);
+ return (EINVAL);
}
t = malloc(sizeof(struct dll));
@@ -1545,13 +1543,13 @@
if (attach_dll(t) == EEXIST) {
free(t);
fputs("dll conflict", stderr);
- return (-1);
+ return (EEXIST);
}
m = dlsym(t->handle, "handlers");
if ((error = dlerror()) != NULL) {
fputs(error, stderr);
- return (-1);
+ return (EINVAL);
}
attach_handlers(m);
_______________________________________________
p4-projects@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/p4-projects
To unsubscribe, send any mail to "p4-projects-unsubscribe@xxxxxxxxxxx"
|
|