From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pete Zaitcev Subject: Re: [PATCH] Some minor CLD test program fixes Date: Sat, 28 Nov 2009 01:17:06 -0700 Message-ID: <20091128011706.5a2e2cd8@redhat.com> References: <1259364036-19428-1-git-send-email-cmccabe@alumni.cmu.edu> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1259364036-19428-1-git-send-email-cmccabe@alumni.cmu.edu> Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: cmccabe@alumni.cmu.edu Cc: Project Hail List , Jeff Garzik , cmccabe On Fri, 27 Nov 2009 15:20:36 -0800 cmccabe@alumni.cmu.edu wrote: > When doing a raw read(2) in cld_readport(), resume after EINTR. > Also resume if we read less than the requested amount. > if ((fd = open(fname, O_RDONLY)) == -1) > return -errno; > - rc = read(fd, buf, LEN); > + memset(buf, 0, sizeof(buf)); > + rc = safe_read(fd, buf, LEN); > close(fd); I don't think it's necessary when reading from a file. > In the test programs, call g_thread_init() before cldc_init(). > cldc_init has a > stern warning to "call cldc_init after g_thread_init, if present." This may be a prudent thing to do, I just forgot about the tests when I planned this. -- Pete