svn commit: samba r23984 - in
branches/SAMBA_3_0_25/source/tdb/common: .
obnox at samba.org
obnox at samba.org
Sat Jul 21 20:01:54 GMT 2007
Author: obnox
Date: 2007-07-21 20:01:53 +0000 (Sat, 21 Jul 2007)
New Revision: 23984
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23984
Log:
Merge r23980:
Fix one more use of pwrite in expand_file.
Michael
Modified:
branches/SAMBA_3_0_25/source/tdb/common/io.c
Changeset:
Modified: branches/SAMBA_3_0_25/source/tdb/common/io.c
===================================================================
--- branches/SAMBA_3_0_25/source/tdb/common/io.c 2007-07-21 19:56:28 UTC (rev 23983)
+++ branches/SAMBA_3_0_25/source/tdb/common/io.c 2007-07-21 20:01:53 UTC (rev 23984)
@@ -221,7 +221,16 @@
if (ftruncate(tdb->fd, size+addition) == -1) {
char b = 0;
- if (pwrite(tdb->fd, &b, 1, (size+addition) - 1) != 1) {
+ ssize_t written = pwrite(tdb->fd, &b, 1, (size+addition) - 1);
+ if (written == 0) {
+ /* try once more, potentially revealing errno */
+ written = pwrite(tdb->fd, &b, 1, (size+addition) - 1);
+ }
+ if (written == 0) {
+ /* again - give up, guessing errno */
+ errno = ENOSPC;
+ }
+ if (written != 1) {
TDB_LOG((tdb, TDB_DEBUG_FATAL, "expand_file to %d failed (%s)\n",
size+addition, strerror(errno)));
return -1;
More information about the samba-cvs
mailing list