Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Jun 2013 13:45:47 GMT
From:      dpl@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r253682 - in soc2013/dpl/head: contrib/bzip2 usr.bin/bzip2
Message-ID:  <201306291345.r5TDjlie044820@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dpl
Date: Sat Jun 29 13:45:47 2013
New Revision: 253682
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=253682

Log:
  Added debugging printf.
  

Modified:
  soc2013/dpl/head/contrib/bzip2/bzip2.c
  soc2013/dpl/head/usr.bin/bzip2/Makefile

Modified: soc2013/dpl/head/contrib/bzip2/bzip2.c
==============================================================================
--- soc2013/dpl/head/contrib/bzip2/bzip2.c	Sat Jun 29 13:33:23 2013	(r253681)
+++ soc2013/dpl/head/contrib/bzip2/bzip2.c	Sat Jun 29 13:45:47 2013	(r253682)
@@ -235,7 +235,7 @@
 
    struct msghdr msg;   
    struct cmsghdr *cmsg;
-   char buf = { 0 };
+   char buf = { "!" };
    struct iovec io[1];
 
    io[0].iov_base = buf;
@@ -248,11 +248,13 @@
    msg.msg_control = cmsg;
    msg.msg_controllen = CMSG_LEN(sizeof(int));
 
+   printf("About to set CMSG\n");
    cmsg->cmsg_len = msg.msg_controllen;
    cmsg->cmsg_level = SOL_SOCKET;
    cmsg->cmsg_type = SCM_RIGHTS;
+   printf("About to set CMSG_DATA as fd\n");
    *(int *)CMSG_DATA(cmsg) = fd;
-   /*Why does sendmsg set errno to 9 EBADF.*/
+   printf("CMSG_DATA = fd\n");
    if(sendmsg(s, &msg, 0) < 0)
       return -1;
    return 0;
@@ -261,12 +263,11 @@
 int
 recvfd(int s)
 {
-   printf("recvfd on socket:%d\n",s);
 
    int fd;
    struct msghdr msg;   
    struct cmsghdr *cmsg;
-   char buf = { 0 };
+   char buf = { "!" };
    struct iovec io[1];
 
    io[0].iov_base = buf;

Modified: soc2013/dpl/head/usr.bin/bzip2/Makefile
==============================================================================
--- soc2013/dpl/head/usr.bin/bzip2/Makefile	Sat Jun 29 13:33:23 2013	(r253681)
+++ soc2013/dpl/head/usr.bin/bzip2/Makefile	Sat Jun 29 13:45:47 2013	(r253682)
@@ -7,6 +7,7 @@
 CFLAGS+= -D_FILE_OFFSET_BITS=64
 #TODO: Delete this.
 CFLAGS+= -fno-color-diagnostics
+CFLAGS+= -Wall
 CFLAGS+= -g
 
 WARNS?=	3



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306291345.r5TDjlie044820>