From de368e09cb310d4625995f1f47cc992f482d76fa Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 27 Mar 2001 00:28:01 +0000 Subject: Fix for ENOSPC from DCB. Jeremy. (This used to be commit 55fcd71eecf4477c56fc4a01bda6d452d3b0caa4) --- source3/utils/nbio.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'source3') diff --git a/source3/utils/nbio.c b/source3/utils/nbio.c index 973f7d0628..4866e52d4e 100644 --- a/source3/utils/nbio.c +++ b/source3/utils/nbio.c @@ -128,8 +128,14 @@ void nb_write(int handle, int size, int offset) return; } if (cli_smbwrite(c, ftable[i].fd, buf, offset, size) != size) { - printf("(%d) write failed on handle %d\n", - line_count, handle); + printf("(%d) write failed on handle %d, fd %d \ +errno %d (%s)\n", line_count, handle, ftable[i].fd, errno, strerror(errno)); + if (errno == ENOSPC) { + printf("Halting.\n"); + fflush(stdout); + fflush(stderr); + exit(3); + } } } @@ -147,8 +153,8 @@ void nb_read(int handle, int size, int offset) } if ((ret=cli_read(c, ftable[i].fd, buf, offset, size)) != size) { #if NBDEBUG - printf("(%d) read failed on handle %d ofs=%d size=%d res=%d\n", - line_count, handle, offset, size, ret); + printf("(%d) read failed on handle %d ofs=%d size=%d res=%d fd %d errno %d (%s)\n", + line_count, handle, offset, size, ret, ftable[i].fd, errno, strerror(errno)); #endif } } -- cgit