bglibs-1.024 make problem on FreeBSD 5.4p5

"David J. Weller-Fahy" <[email protected]> Sun, 24 Jul 2005 13:35:03 +0201
Newsgroups gmane.comp.sysutils.bgware
Message-ID <[email protected]>
I had a bit of trouble making bglibs last night, and thought the
solution might be useful to someone else, so here's the info.  BTW -
this is the first time I've ever built bglibs by hand, so I may have
made a trivial mistake somewhere, please correct me if you see it one.

uname -a:
#v+
FreeBSD tigger.weller-fahy.com 5.4-RELEASE-p5 FreeBSD 5.4-RELEASE-p5 #0: Wed Jul 20 18:49:58 CEST 2005
[email protected]:/usr/obj/usr/src/sys/GENERIC  i386
#v-

Full output of the make command is located at:
<http://weller-fahy.com/errors/bglibs-1.024-make-error.txt>

The relevant portion is:
#v+
./compile bg-installer.c
bg-installer.c:156: error: conflicting types for 'setmode'
/usr/include/unistd.h:529: error: previous declaration of 'setmode' was here
bg-installer.c:156: error: conflicting types for 'setmode'
/usr/include/unistd.h:529: error: previous declaration of 'setmode' was here
bg-installer.c: In function `checkmode':
bg-installer.c:178: warning: comparison between signed and unsigned
bg-installer.c:180: warning: comparison between signed and unsigned
*** Error code 1

Stop in /home/dave/installed/bglibs-1.024.
#v-

The file unistd.h is: <http://weller-fahy.com/errors/unistd.h>

After digging through the bg-installer.c and unistd.h files, and finding
what I believed to be the problem, I ran 'grep -r setmode *' in the
bglibs, cvm, and mailfront source directories.  The only relevant hits
were in bg-installer.c, so I changed all instances of the function name
'setmode' in bg-installer.c to 'bgsetmode'.  That allowed it to make,
and install.

The patch I created using 'diff -uBb' (trivial, probably doesn't need to
be a patch) is: <http://weller-fahy.com/errors/bg-installer.c.patch>

However, I wanted to make sure that changing the name of setmode would
not have some unexpected consequences down the road, and bring this
error to the attention of the author, so here I am.

So, is there anything else I should have done to fix the problem?  If
so, what is the correct solution?  Or was changing the function name
correct?

Regards,
-- 
David J. Weller-Fahy        | 'These are the questions that kept me out
largely at innocent dot com |  of the really *good* schools.'
www dot weller-fahy dot com |                  - One of The Group