mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Use pg_pwrite() in more places.
This removes some lseek() system calls. Author: Thomas Munro Reviewed-by: Andres Freund Discussion: https://postgr.es/m/CA%2BhUKGJ%2BoHhnvqjn3%3DHro7xu-YDR8FPr0FL6LF35kHRX%3D_bUzg%40mail.gmail.com
This commit is contained in:
@ -1868,12 +1868,9 @@ qtext_store(const char *query, int query_len,
|
||||
if (fd < 0)
|
||||
goto error;
|
||||
|
||||
if (lseek(fd, off, SEEK_SET) != off)
|
||||
if (pg_pwrite(fd, query, query_len, off) != query_len)
|
||||
goto error;
|
||||
|
||||
if (write(fd, query, query_len) != query_len)
|
||||
goto error;
|
||||
if (write(fd, "\0", 1) != 1)
|
||||
if (pg_pwrite(fd, "\0", 1, off + query_len) != 1)
|
||||
goto error;
|
||||
|
||||
CloseTransientFile(fd);
|
||||
|
Reference in New Issue
Block a user