From: Angel C. <ac...@te...> - 2008-03-06 09:26:32
|
Hi Rowan , El jue, 06-03-2008 a las 18:17 +1100, Rowan 2008 escribió: > Tried to compile the latest SVN, get this error at linking: > > /usr/src/motionsvn/conf.c:1623: undefined reference to `get_current_dir_name' > gmake: *** [motion] Error 1 > > conf.c:1623: snprintf(filename, PATH_MAX, "%s/motion.conf", > get_current_dir_name()); Yah ! you are right i didn't check that it was not supported :-/ > I had a quick look and get_current_dir_name() appears to be a Linux > specific function (or at least unsupported in FreeBSD) that returns a > pointer to a dynamic buffer. Is it possible to change this code to use > getcwd() instead? (I could probably do a nasty hack in about 30 seconds > but it's not something I'd submit :) ) I've added a check in configure.in to detect if get_current_dir_name() exists , if it does not a fuction is defined using getcwd(). > BTW, since the above line ignores the returned buffer pointer wouldn't > this be a memory leak? Interesting things could also happen if NULL was > returned by get_current_dir_name() ? Also check return value and free buffer. Check out latest svn ;-) > (I can find my way around C but I'm not that experienced with program > structure and convention, so ignore me if I'm being silly) > > Cheers. Cheers, -- Angel Carpintero ack ( at ) telefonica ( dot ) net Key fingerprint = 3FD3 9C90 149E 7824 CECD 6BCF AC2C CA61 6EF1 B90D "No basta saber, hay que aplicar lo que se sabe; no basta querer hacerlas cosas, hay que hacerlas". "Knowing is not enough; we must apply. Willing is not enough; we must do" Johann Wolfgang von Goethe |