PERFORCE change 100750 for review

Paolo Pisati piso at FreeBSD.org
Thu Jul 6 13:39:00 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=100750

Change 100750 by piso at 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);


More information about the p4-projects mailing list