Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Michael Brennen <mbrennen@fni.com>
Subject: rpm 2.2.[56] failures
Date: Mon, 14 Oct 1996 23:47:49 -0500 (CDT)	[thread overview]
Message-ID: <8da39e8302ea41281871217f00b25521.axp-list@archive.invalid> (raw)

I wrote earlier about rpm 2.2.5 failing.  Marin Purgar helped me create
rpm 2.2.6 (thanks!), and it failed the same way.

After some debugging I found the reason.  The failure is in
~/lib/install.c at the write on line 671:

if ( write(p[1]), buf, bytesRead) != bytesRead )

If bytesRead is zero (from the previous gzread()), the write will fail,
returning -1.  My quick fix was to change line 672. 

Old:       cpioFailed = 1;

New:       if (bytesRead) cpioFailed =1;

This is on linux 2.1.3.  I don't know if the 2.1.x series changed expected
behaviour of write() or if this is an error of rpm 2.2.[56].  From the
write(2) man page; the note about the special file should apply here, as
this is a pipe. 

RETURN VALUE
       On success, the number of bytes written are returned (zero
       indicates nothing was written).  On error, -1 is returned,
       and  errno is set appropriately.  If count is zero and the
       file descriptor refers  to  a  regular  file,  0  will  be
       returned  without causing any other effect.  For a special
       file, the results are not portable.

Comments are welcome, but it looks like an rpm bug to me.

   -- Michael

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

             reply	other threads:[~1996-10-15  4:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-15  4:47 Michael Brennen [this message]
     [not found] <Pine.LNX.3.95.961014232120.16058C-100000@ns1.fni.com>
1996-10-15  8:12 ` rpm 2.2.[56] failures Linus Torvalds
1996-10-15 12:58 ` Erik Troan
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox