Return value of lseek() can be negative on failure.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 14 Jan 2013 22:42:37 +0000 (00:42 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 14 Jan 2013 22:42:37 +0000 (00:42 +0200)
Because the return value of lseek() was assigned to an unsigned size_t
variable, we'd fail to notice an error return code -1. Compiler gave a
warning about this.

Andres Freund

src/backend/replication/walsender.c

index 5408b142f8d9b7d0522327c9daafc36090ba4348..ad7d1c911b377d94bb21fc20a72521b2bb72d3ac 100644 (file)
@@ -315,8 +315,8 @@ SendTimeLineHistory(TimeLineHistoryCmd *cmd)
    char        histfname[MAXFNAMELEN];
    char        path[MAXPGPATH];
    int         fd;
-   size_t      histfilelen;
-   size_t      bytesleft;
+   off_t       histfilelen;
+   off_t       bytesleft;
 
    /*
     * Reply with a result set with one row, and two columns. The first col