VirtualBox

Ignore:
Timestamp:
Dec 18, 2007 4:06:36 PM (17 years ago)
Author:
vboxsync
Message:

Fixed guest driver session handling, fixed daemonizing. timesync works.

Location:
trunk/src/VBox/Additions/common/VBoxService
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/Makefile.kmk

    r6118 r6132  
    3939        $(VBOX_LIB_VBGL_R3) \
    4040        $(VBOX_LIB_IPRT_GUEST_R3)
     41VBoxService_LIBS.solaris  = daemon
    4142
    4243include $(PATH_KBUILD)/subfooter.kmk
  • trunk/src/VBox/Additions/common/VBoxService/VBoxService-solaris.cpp

    r6121 r6132  
    2626#include <signal.h>
    2727#include <fcntl.h>
     28#include <libdaemon/dfork.h>
     29#include <libdaemon/dsignal.h>
    2830
    2931/**
    30  * Solaris daemon() call. Probably might work for other Unix.
     32 * Solaris daemon() call uses libdaemon.
    3133 *
    3234 * @returns 0 on success
     
    3436int daemon(int nochdir, int noclose)
    3537{
     38    pid_t pid = daemon_fork();
     39    if (pid < 0)
     40    {
     41        daemon_retval_done();
     42        return -1;
     43    }
     44
     45    if (pid)
     46        exit(0);
     47
     48    daemon_close_all(-1);
     49    return 0;
     50#if 0
    3651    if (getppid() == 1) /* We already belong to init process */
    3752        return -1;
     
    5267    int size = getdtablesize();
    5368    if (size < 0)
    54         size = 3;
     69        size = 2;
    5570
    5671    for (int i = size; i >= 0; i--)
     
    7489    }
    7590    return 0;
     91#endif
    7692}
    7793
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette