fd,c just Assert()s that lseek() succeeds

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: fd,c just Assert()s that lseek() succeeds
Date: 2017-02-20 05:17:25
Message-ID: 19699.1487567845@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I noticed while researching bug #14555 that fd.c contains two separate
cases like

vfdP->seekPos = lseek(vfdP->fd, (off_t) 0, SEEK_CUR);
Assert(vfdP->seekPos != (off_t) -1);

This seems, um, unwise. It might somehow fail to fail in production
builds, because elsewhere it's assumed that -1 means FileUnknownPos,
but it seems like reporting the error would be a better plan.

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2017-02-20 05:24:16 Re: Parallel Append implementation
Previous Message Rafia Sabih 2017-02-20 04:41:35 Re: Passing query string to workers