Print this page
10100 Illumos is confused about calloc() arguments
@@ -21,13 +21,14 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright (c) 2018, Joyent, Inc.
+ */
-
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <proc_service.h>
#include <link.h>
@@ -160,11 +161,11 @@
rd_new(struct ps_prochandle *php)
{
rd_agent_t *rap;
LOG(ps_plog(MSG_ORIG(MSG_DB_RDNEW), php));
- if ((rap = (rd_agent_t *)calloc(sizeof (rd_agent_t), 1)) == NULL)
+ if ((rap = (rd_agent_t *)calloc(1, sizeof (rd_agent_t))) == NULL)
return (0);
rap->rd_psp = php;
(void) mutex_init(&rap->rd_mutex, USYNC_THREAD, 0);
if (rd_reset(rap) != RD_OK) {