chiark / gitweb /
move some info() to dbg()
[elogind.git] / udev / lib / libudev-ctrl.c
index 848f5078783db4a2a4080df73b7eb08083c9d3b0..caf0dc08a363e29bf415954adaf0838b6f526726 100644 (file)
@@ -72,10 +72,9 @@ struct udev_ctrl *udev_ctrl_new_from_socket(struct udev *udev, const char *socke
 {
        struct udev_ctrl *uctrl;
 
-       uctrl = malloc(sizeof(struct udev_ctrl));
+       uctrl = calloc(1, sizeof(struct udev_ctrl));
        if (uctrl == NULL)
                return NULL;
-       memset(uctrl, 0x00, sizeof(struct udev_ctrl));
        uctrl->refcount = 1;
        uctrl->udev = udev;
 
@@ -213,10 +212,9 @@ struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl *uctrl)
        struct ucred *cred;
        char cred_msg[CMSG_SPACE(sizeof(struct ucred))];
 
-       uctrl_msg = malloc(sizeof(struct udev_ctrl_msg));
+       uctrl_msg = calloc(1, sizeof(struct udev_ctrl_msg));
        if (uctrl_msg == NULL)
                return NULL;
-       memset(uctrl_msg, 0x00, sizeof(struct udev_ctrl_msg));
        uctrl_msg->refcount = 1;
        uctrl_msg->uctrl = uctrl;
 
@@ -252,7 +250,7 @@ struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl *uctrl)
                goto err;
        }
 
-       info(uctrl->udev, "created ctrl_msg %p (%i)\n", uctrl_msg, uctrl_msg->ctrl_msg_wire.type);
+       dbg(uctrl->udev, "created ctrl_msg %p (%i)\n", uctrl_msg, uctrl_msg->ctrl_msg_wire.type);
        return uctrl_msg;
 err:
        udev_ctrl_msg_unref(uctrl_msg);
@@ -274,7 +272,7 @@ void udev_ctrl_msg_unref(struct udev_ctrl_msg *ctrl_msg)
        ctrl_msg->refcount--;
        if (ctrl_msg->refcount > 0)
                return;
-       info(ctrl_msg->uctrl->udev, "release ctrl_msg %p\n", ctrl_msg);
+       dbg(ctrl_msg->uctrl->udev, "release ctrl_msg %p\n", ctrl_msg);
        free(ctrl_msg);
 }