Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory
От | Chris Jones |
---|---|
Тема | Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory |
Дата | |
Msg-id | 20010523113915.E437@mt.sri.com обсуждение исходный текст |
Ответ на | Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory
Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory |
Список | pgsql-general |
On Wed, May 23, 2001 at 12:50:46PM -0400, Tom Lane wrote: > errno = 0; > if (write(...) != expectedbytecount) > { > int save_errno = errno; > > unlink(tmp); > > errno = save_errno ? save_errno : ENOSPC; > > elog(...); > } > > Comments? Is it reasonable to guess that the problem must be ENOSPC > if write doesn't write all the bytes but also doesn't set errno? No, it could be any number of other things. The first that comes to mind is EINTR. How about something closer to: totalwritten = 0; while(totalwritten < expectedbytecount) { lastwritten = write(...); if(lastwritten == -1) { /* errno is guaranteed to be set */ if(errno == EINTR) { continue; } unlink(tmp); elog(...); break; } else if(lastwritten == 0) { /* errno should be 0. Considering this an error is probably a BAD idea. */ unlink(tmp); elog(...); break; } else { /* we got a partial write count. No problem; try again. */ totalwritten += lastwritten; } } Chris -- chris@mt.sri.com ----------------------------------------------------- Chris Jones SRI International, Inc. www.sri.com
Вложения
В списке pgsql-general по дате отправления: