+Wed Jul 12 10:40:23 1995 H.J. Lu <hjl@nynexst.com>
+
+ * objcopy.c (simple_copy): Preserve errno on failure.
+ (smart_rename): Print error mesage if simple_copy fails.
+
+Tue Jul 11 13:10:52 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * sysdump.c: re-indented file.
+ (module): read blocks sequentially instead of trying to parse
+ them, as that would require changing the parser recognize the
+ difference between a DPSstart and DPSend block.
+ (getone): Add break's between switch blocks as appropriate.
+ (object_body_list): parse blocks according to sysroff spec.
+
+Mon Jul 10 12:37:25 1995 J.T. Conklin <jtc@poseidon.cygnus.com>
+
+ * sysroff.info: re-indented file, prior formatting was confusing
+ because it was indentation did not reflect nesting of conditional
+ records. Change "space size within segment" record in hd record
+ from bit to byte.
+
+ * sysinfo.y (cond_it_field): Use xcalloc instead of calloc.
+
+ * srconv.c (wr_cs): Reformatted cs header array, tag each byte
+ with a comment describing the field.
+ (wr_unit_info): Use SEEK_SET macro instead of constant 0.
+ (main): Use FOPEN_WB macro instead of literal "wb".
+ * sysroff.info: Remove fdl (dfl) field from cs block. Compare
+ ptr->type with ED_TYPE_CONST instead of constant 2 in ed block.
+
Tue Jul 4 14:48:42 1995 Ian Lance Taylor <ian@cygnus.com>
* nm.c (size_forward): Check yf against yn, not xn.
* dlltool.c: Change names of generated files. .*.s-> -*.s
* objdump.c (dump_section_stabs): Check for names
- which are supersets of selected names. binutils/7240.
+ which are supersets of selected names.
Wed Jun 14 19:43:52 1995 Doug Evans <dje@canuck.cygnus.com>
Mon Jun 12 11:27:54 1995 Steve Chamberlain <sac@slash.cygnus.com>
* sysdump.c: Include sysdep.h
- (main): Open input with FOPEN_RB. binutils/7137
+ (main): Open input with FOPEN_RB.
Fri Jun 9 17:26:11 1995 Michael Meissner <meissner@tiktok.cygnus.com>
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
\f
#include "bfd.h"
#include "sysdep.h"
char *from, *to;
{
int fromfd, tofd, nread;
+ int saved;
char buf[COPY_BUF];
fromfd = open (from, O_RDONLY);
tofd = open (to, O_WRONLY | O_CREAT | O_TRUNC);
if (tofd < 0)
{
+ saved = errno;
close (fromfd);
+ errno = saved;
return -1;
}
while ((nread = read (fromfd, buf, sizeof buf)) > 0)
{
if (write (tofd, buf, nread) != nread)
{
+ saved = errno;
close (fromfd);
close (tofd);
+ errno = saved;
return -1;
}
}
+ saved = errno;
close (fromfd);
close (tofd);
if (nread < 0)
- return -1;
+ {
+ errno = saved;
+ return -1;
+ }
return 0;
}
{
/* We have to clean up here. */
int saved = errno;
- fprintf (stderr, "%s: `%s': ", program_name, to);
+ fprintf (stderr, "%s: %s: ", program_name, to);
errno = saved;
perror ("rename");
unlink (from);
else
{
ret = simple_copy (from, to);
- if (ret == 0)
- unlink (from);
+ if (ret != 0)
+ {
+ int saved = errno;
+ fprintf (stderr, "%s: %s: ", program_name, to);
+ errno = saved;
+ perror ("simple_copy");
+ }
+ unlink (from);
}
return ret;
}