Ignore:
Timestamp:
04/26/13 00:49:52 (6 years ago)
Author:
Nicholas Riley
Message:

VERSION: Updated for 1.1.1d5.

main.c: Replace use of daemon(3), which was deprecated in Mac OS X
10.5. Updated for 1.1.1d5.

README: Updated for 1.1.1d5.

Note: man page is out of date, needs updating before 1.1 is released.

Should also investigate enabling BROKEN_ARGUMENTS and either enabling
or removing BROKEN_AUTHORIZATION.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/launch/launch/main.c

    r651 r661  
    3737const char *APP_NAME;
    3838
    39 #define VERSION "1.1.1d4"
     39#define VERSION "1.1.1d5"
    4040
    4141#define STRBUF_LEN 1024
     
    944944}
    945945
     946void background() {
     947    if (fork() > 1)
     948        exit(0);
     949   
     950    int fd;
     951   
     952    if ( (fd = open("/dev/null", O_RDWR, 0)) != -1) {
     953        dup2(fd, STDIN_FILENO);
     954        dup2(fd, STDOUT_FILENO);
     955        dup2(fd, STDERR_FILENO);
     956    }
     957}
     958
    946959int main (int argc, char * const argv[]) {
    947960    OSStatus err;
     
    10011014    if (TEMPFILE != NULL) {
    10021015        // the application may take a while to finish opening the temporary file
    1003         daemon(0, 0);
     1016        background();
    10041017        sleep(60);
    10051018        unlink(TEMPFILE);
Note: See TracChangeset for help on using the changeset viewer.