Print this page
10100 Illumos is confused about calloc() arguments

@@ -20,10 +20,12 @@
  */
 
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2018, Joyent, Inc.
  */
 
 #include <stdlib.h>
 #include <strings.h>
 #include <unistd.h>

@@ -58,11 +60,11 @@
         int                     sobufsz;
 
         if (hp == NULL)
                 return (ILB_STATUS_EINVAL);
 
-        hi = calloc(sizeof (*hi), 1);
+        hi = calloc(1, sizeof (*hi));
         if (hi == NULL)
                 return (ILB_STATUS_ENOMEM);
 
         if (cond_init(&hi->h_cv, USYNC_THREAD, NULL) != 0) {
                 rc = ILB_STATUS_INTERNAL;