FreeBSD7.3 で Postfix がコンパイルエラー

FreeBSD7.3がリリースされていたので早速取得し空いているHDにインストールした。pakages をいくつか入れてから、いくつかのフリーソフトports を使わずオリジナルソースからインストールしてみた。そうしたところ postfix-2.7.0 のインストールでコンパイルエラーとなった。実施手順は、以下の通り

cd postfix-2.7.0
make tidy
make makefiles CCARGS="-DUSE_TLS -DUSE_CYRUS_SASL -DUSE_SASL_AUTH -I/usr/local/include -I/usr/local/include/sasl" AUXLIBS="-L/usr/local/lib -lssl -lcrypto -lsasl2"
make 

ガンガンコンパイルが進み始めたのだが、いきなり

In file included from attr_clnt.c:77:
/usr/include/unistd.h:329: error: conflicting types for 'closefrom'
./sys_defs.h:1400: error: previous declaration of 'closefrom' was here
*** Error code 1

Stop in /usr/local/src/postfix-2.7.0/src/util.
*** Error code 1

Stop in /usr/local/src/postfix-2.7.0.

とエラーで中断してしまった。メッセージからすると unistd.h で定義している closefrom がコンフリクトしているようだ。調べてみると Postfix の include/sys_defs.h の closefrom は、

extern int closefrom(int);

一方、FreeBSD7.2 の /usr/include/unistd.h で定義してある closefrom は、

void closefrom(int)

となっており、int と void と違いがあるようだ。Postfix 側を直してもいいのだが、FreeBSD7.3 の /usr/include/unistd.h の closefrom を int に変更してみた。

int closefrom(int)

make を再開し問題なく postfix の make と install ができた。動作も問題なくバッチリであった。