2011/10/5 stefan novak <lms.bruba...@gmail.com>:
> Hello!
> When you want to compile mod_fcgid als build in static module it fails with:
> modules/fcgid/.libs/libmod_fcgid.a(fcgid_mutex_unix.o): In function
> `fcgid_mutex_create':
> fcgid_mutex_unix.c:(.text+0x65): warning: the use of `tmpnam' is dangerous,
> better use `mkstemp'
> make[1]: Leaving directory `/root/rpmbuild/SOURCES/httpd-2.2.21'

this is only a warning, are You sure httpd fails to build ?

> The following patch helps, but i dont know if its the right solution.
> 1129#centos6-build:diff modules/fcgid/fcgid_mutex_unix.c
> ../mod_fcgid-2.3.6/modules/fcgid/fcgid_mutex_unix.c
> 118c118
> <     mkstemp(lockfile);
> ---
>>     tmpnam(lockfile);
> Can someone check it?

I think this won't work

from man

The  mkstemp()  function generates a unique temporary filename from
template, creates and opens the file, and returns an open file
descriptor for the file.

The  tmpnam() function returns a pointer to a string that is a valid
filename, and such that a file with this name did not exist at some
point in time

tmpnam() creates a temporary filename in lockfile which is used by
apr_global_mutex_create()

mkstemp() won't touch lockfile so apr_global_mutex_create() will get
always same empty string, i think this might work on some platforms
where default lock mechanism doesn't need a filename

-- 
Michal Grzedzicki

Reply via email to