Author: marcel
Date: Fri Dec 18 21:12:37 2009
New Revision: 200691
URL: http://svn.freebsd.org/changeset/base/200691

Log:
  Fix ub_env_enum(): syscall() returns 0 when properly invoked.

Modified:
  head/sys/boot/uboot/lib/glue.c

Modified: head/sys/boot/uboot/lib/glue.c
==============================================================================
--- head/sys/boot/uboot/lib/glue.c      Fri Dec 18 21:02:32 2009        
(r200690)
+++ head/sys/boot/uboot/lib/glue.c      Fri Dec 18 21:12:37 2009        
(r200691)
@@ -568,17 +568,16 @@ ub_env_enum(const char *last)
        const char *env, *str;
        int i;
 
-       env = NULL;
-
        /*
         * It's OK to pass only the name piece as last (and not the whole
         * 'name=val' string), since the API_ENUM_ENV call uses envmatch()
         * internally, which handles such case
         */
-       if (!syscall(API_ENV_ENUM, NULL, (uint32_t)last, (uint32_t)&env))
+       env = NULL;
+       if (syscall(API_ENV_ENUM, NULL, (uint32_t)last, (uint32_t)&env) != 0)
                return (NULL);
 
-       if (!env)
+       if (env == NULL)
                /* no more env. variables to enumerate */
                return (NULL);
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to