Bug 3573 - timelimit.c unable to compile on Mac OS X 10.4.5 (incl. fix)
Summary: timelimit.c unable to compile on Mac OS X 10.4.5 (incl. fix)
Status: RESOLVED FIXED
Alias: None
Product: BuildFarm
Classification: Unclassified
Component: scripts (show other bugs)
Version: unspecified
Hardware: PPC Mac OS X
: P3 major
Target Milestone: ---
Assignee: Vance Lankhaar
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-02 10:52 UTC by Ronald van den Blink
Modified: 2006-03-03 03:09 UTC (History)
2 users (show)

See Also:


Attachments
patch for Darwin (Mac OS X) setpgrp (386 bytes, patch)
2006-03-02 19:52 UTC, Steffond Jones
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ronald van den Blink 2006-03-02 10:52:30 UTC
On Darwin Kernel Version 8.5.0 (Mac OS X 10.4.5) it isn't possible to run the build_test.sh because of an error in timelimit.c. The problem is located at the new_process_group function:

Mac OS X uses setpgrp(0,0) but it doesn't define BSD_SETPGRP. The easy sollution is to command out the #ifdef BSD_SETPGRP line and the else statement, but a nicer fix is on you :)

timelimit.c:
static void new_process_group(void)
{
#ifdef BSD_SETPGRP
        if (setpgrp(0,0) == -1) {
                perror("setpgrp");
                exit(1);
        }
#else
        if (setpgrp() == -1) {
                perror("setpgrp");
                exit(1);
        }
#endif
}
Comment 1 Ronald van den Blink 2006-03-02 17:30:07 UTC
Oke, I have a dirty, evil, patch right here. In unistd.h (wich is included by timelimit.c) I added the following two lines:

#ifndef BSD_SETPGRP
#define BSD_SETPGRP
#endif                                                                                                                          

Now gcc thinks that BSD_SETPRGRP is set, so it compiles timelimit.c, but I still like to see this fixed in timelimit itself :)

I change to severity to major because it isn't blocking anymore...
Comment 2 Steffond Jones 2006-03-02 19:52:46 UTC
Created attachment 1770 [details]
patch for Darwin (Mac OS X) setpgrp
Comment 3 Vance Lankhaar 2006-03-02 21:34:08 UTC
Steffond's fix looks good to me - thanks for the quick patch! I've committed it - let's see if the farm likes it :-)

Cheers,
Vance

Comment 4 Ronald van den Blink 2006-03-03 03:09:30 UTC
The fix fixed it :)