Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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: clogpatch.diff
Description: text/plain (549 bytes)

Responses

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group