Fix for compile error clog.c

From: Rene Pijlman <rpijlman(at)wanadoo(dot)nl>
To: pgsql-patches(at)postgresql(dot)org
Subject: Fix for compile error clog.c
Date: 2001-08-25 19:50:40
Message-ID: bfvfotohusn6bqi25c3tejc8prvjellvff@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

I'm getting a compile error in src/backend/access/transam in
current CVS:

gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
-I../../../../src/include -c -o clog.o clog.c
clog.c: In function `CLOGPhysicalReadPage':
clog.c:542: `S_IRUSR' undeclared (first use in this function)
clog.c:542: (Each undeclared identifier is reported only once
clog.c:542: for each function it appears in.)
clog.c:542: `S_IWUSR' undeclared (first use in this function)
clog.c: In function `CLOGPhysicalWritePage':
clog.c:593: `S_IRUSR' undeclared (first use in this function)
clog.c:593: `S_IWUSR' undeclared (first use in this function)
make: *** [clog.o] Error 1

The manual page open(2) on my Red Hat Linux 7.1 box says:

SYNOPSIS
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int open(const char *pathname, int flags);

clog.c includes only <fcntl.h>. And indeed, when I add the
includes <sys/types.h> and <sys/stat.h> it compiles fine. So it
seems clog.c is just missing a few includes.

Attached is a patch to fix this problem. I see the same includes
in other files (e.g. xlog.c), so I assume this is portable.

Regards,
René Pijlman

Attachment Content-Type Size
clogpatch.diff text/plain 549 bytes

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Larry Rosenman 2001-08-25 23:15:33 Re: [PATCHES] Makefile.PL for Pg.so
Previous Message Bruce Momjian 2001-08-25 17:45:56 Encryption addition to createuser