X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffull-write.c;h=1feb2f7431145cb011b811db7a3ae8b25f4650f2;hb=daa689ebb8beb42e803445c882f20a175eb51b7f;hp=9f30b85a3619284297f4edfb4b9c4b41b2068249;hpb=c0ffdfa7ccba02e94b40a485b9bd411dd32c9ab8;p=gnulib.git diff --git a/lib/full-write.c b/lib/full-write.c index 9f30b85a3..1feb2f743 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, 1994 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1997, 1998, 2000 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 @@ -18,13 +18,13 @@ Copied largely from GNU C's cccp.c. */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H # include #endif #include -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H # include #endif @@ -37,10 +37,7 @@ extern int errno; Return LEN upon success, write's (negative) error code otherwise. */ int -full_write (desc, ptr, len) - int desc; - char *ptr; - size_t len; +full_write (int desc, const char *ptr, size_t len) { int total_written; @@ -48,6 +45,11 @@ full_write (desc, ptr, len) while (len > 0) { int written = write (desc, ptr, len); + /* write on an old 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 you have this problem, + consider upgrading to a newer kernel. */ if (written < 0) { #ifdef EINTR