File libcgroup-print_to_perror.patch of Package libcgroup1
--- libcgroup-0.32.1/cgrulesengd.c.old 2008-11-05 12:22:07.324649000 +0100
+++ libcgroup-0.32.1/cgrulesengd.c 2008-11-05 12:58:40.988788000 +0100
@@ -283,7 +283,7 @@
*/
sk_nl = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
if (sk_nl == -1) {
- printf("socket sk_nl error");
+ perror("socket sk_nl error");
return rc;
}
@@ -299,14 +299,14 @@
err = bind(sk_nl, (struct sockaddr *)&my_nla, sizeof(my_nla));
if (err == -1) {
- printf("binding sk_nl error");
+ perror("binding sk_nl error");
goto close_and_exit;
}
nl_hdr = (struct nlmsghdr *)buff;
cn_hdr = (struct cn_msg *)NLMSG_DATA(nl_hdr);
mcop_msg = (enum proc_cn_mcast_op*)&cn_hdr->data[0];
- printf("sending proc connector: PROC_CN_MCAST_LISTEN... ");
+ puts("sending proc connector: PROC_CN_MCAST_LISTEN... ");
memset(buff, 0, sizeof(buff));
*mcop_msg = PROC_CN_MCAST_LISTEN;
@@ -326,7 +326,7 @@
printf("sending netlink message len=%d, cn_msg len=%d\n",
nl_hdr->nlmsg_len, sizeof(struct cn_msg));
if (send(sk_nl, nl_hdr, nl_hdr->nlmsg_len, 0) != nl_hdr->nlmsg_len) {
- printf("failed to send proc connector mcast ctl op!\n");
+ perror("failed to send proc connector mcast ctl op!\n");
goto close_and_exit;
}
printf("sent\n");