GNOME Bugzilla – Bug 321493
[PATCH] Latest gdm does not build on FreeBSD
Last modified: 2005-11-15 22:58:58 UTC
Please describe the problem: The latest GDM patch does not build on FreeBSD or DFlyBSD due to the VT_STATE changes. The attached patch attempts to back-port the previous code in the FreeBSD/DFly case. Steps to reproduce: 1. Try to build gdm HEAD or 2.8.0.6 on FreeBSD 2. 3. Actual results: The build dies: getvt.c: In function `get_free_vt': getvt.c:75: error: storage size of 'vtstat' isn't known getvt.c:90: error: `VT_GETSTATE' undeclared (first use in this function) getvt.c:90: error: (Each undeclared identifier is reported only once getvt.c:90: error: for each function it appears in.) getvt.c:75: warning: unused variable `vtstat' Expected results: GDM should build as it has done in the past. Does this happen every time? Yes. Other information: The attached patch is against HEAD. A very similar one is needed for 2.8.0.6.
Created attachment 54769 [details] [review] Fix build on FreeBSD/DFlyBSD
By saying things like: +#if defined(__linux__) something; +#elif defined (__FreeBSD__) || defined(__DragonFly__) + some-new-thing; +#endif patch 54769 is falsely assuming that all machines that are not FreeBSD or DragonFly are linux. You're breaking compile on all machines that aren't any of those but for whom the now-linux-only code ("something") was correct. How about leaving the default case to be the way it was? +#if defined (__FreeBSD__) || defined(__DragonFly__) + some-new-thing; +#else something; +#endif
I completely agree. However, I borrowed that notation from surrounding code (and from the previous revisions of the file). I think that VT auto-detection only works on Linux and FreeBSD/DFlyBSD for now anyway.
Ooh, good point. /me got hypersensitive to linux assumptions, didn't look at the context of the code:(
Fixed in CVS head. I didn't use the provided patch. It seems that the linux and freebsd logic for this function are so different at this point that the #ifdef's just make everything look too messy. Now there are two functions and only one #ifdef to decide which function to call. Also, I copied the old logic for BSD from the previous release of GDM since it seemed to have better cleanup logic. If you disagree that this is appropriate, then let me know the reasoning and we can work this out. Fixed in CVS head and 2.12 branch.