X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffull-write.c;h=1e80b0a8ac2394769c74025fae62a565ce56bf32;hb=391b9b9a642f09d9b6303afdc6900f72eef20f9b;hp=cce5f0f03531ddaba038b15e718b9a41e1494887;hpb=90c1dd8b74406566869f322b6acdb4e54699098a;p=gnulib.git diff --git a/lib/full-write.c b/lib/full-write.c index cce5f0f03..1e80b0a8a 100644 --- a/lib/full-write.c +++ b/lib/full-write.c @@ -1,5 +1,5 @@ /* full-write.c -- an interface to write that retries after interrupts - Copyright (C) 1993 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -12,31 +12,24 @@ GNU General Public License for more details. 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. + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Copied largely from GNU C's cccp.c. */ -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ -#include -#else -#include "config.h" -#endif +#if HAVE_CONFIG_H +# include #endif #include -#ifdef HAVE_UNISTD_H -#include +#if HAVE_UNISTD_H +# include #endif #include -#ifndef STDC_HEADERS +#ifndef errno extern int errno; #endif @@ -47,7 +40,7 @@ int full_write (desc, ptr, len) int desc; char *ptr; - int len; + size_t len; { int total_written; @@ -55,6 +48,10 @@ full_write (desc, ptr, len) while (len > 0) { int written = write (desc, ptr, len); + /* FIXME: write on my slackware Linux 1.2.13 returns zero when + I try to write more data than there is room on a floppy disk. + This puts dd into an infinite loop. Reproduce with + dd if=/dev/zero of=/dev/fd0. */ if (written < 0) { #ifdef EINTR