#include "dbus-sysdeps-win.h"
#include "dbus-sockets-win.h"
#include "dbus-memory.h"
-
-#include <io.h>
-#include <sys/stat.h>
-#include <aclapi.h>
-#include <winsock2.h>
+#include "dbus-pipe.h"
#include <stdio.h>
#include <stdlib.h>
-#include <fcntl.h>
#if HAVE_ERRNO_H
#include <errno.h>
#endif
#include <winsock2.h> // WSA error codes
+#ifndef DBUS_WINCE
+#include <io.h>
+#include <lm.h>
+#include <sys/stat.h>
+#endif
+
+
/**
* Does the chdir, fork, setsid, etc. to become a daemon process.
*
* @param pidfile #NULL, or pidfile to create
- * @param print_pid_fd file descriptor to print daemon's pid to, or -1 for none
+ * @param print_pid_pipe file descriptor to print daemon's pid to, or -1 for none
* @param error return location for errors
* @param keep_umask #TRUE to keep the original umask
* @returns #FALSE on failure
DBusString pid;
int bytes;
- _dbus_verbose ("writing our pid to pipe %d\n", print_pid_pipe->fd_or_handle);
+ _dbus_verbose ("writing our pid to pipe %d\n", print_pid_pipe->fd);
if (!_dbus_string_init (&pid))
{
}
void
-_dbus_init_system_log (void)
+_dbus_request_file_descriptor_limit (unsigned int limit)
+{
+}
+
+void
+_dbus_init_system_log (dbus_bool_t is_daemon)
{
- // FIXME!
+ /* OutputDebugStringA doesn't need any special initialization, do nothing */
}
/**
*
* @param severity a severity value
* @param msg a printf-style format string
- * @param args arguments for the format string
- *
*/
void
_dbus_system_log (DBusSystemLogSeverity severity, const char *msg, ...)
void
_dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args)
{
- // FIXME!
+ char *s = "";
+ char buf[1024];
+
+ switch(severity)
+ {
+ case DBUS_SYSTEM_LOG_INFO: s = "info"; break;
+ case DBUS_SYSTEM_LOG_SECURITY: s = "security"; break;
+ case DBUS_SYSTEM_LOG_FATAL: s = "fatal"; break;
+ }
+
+ sprintf(buf,"%s%s",s,msg);
+ vsprintf(buf,buf,args);
+ OutputDebugStringA(buf);
+
+ if (severity == DBUS_SYSTEM_LOG_FATAL)
+ exit (1);
}
/** Installs a signal handler
dbus_free (iter);
}
-/**
- * Checks whether the filename is an absolute path
- *
- * @param filename the filename
- * @returns #TRUE if an absolute path
- */
-dbus_bool_t
-_dbus_path_is_absolute (const DBusString *filename)
-{
- if (_dbus_string_get_length (filename) > 0)
- return _dbus_string_get_byte (filename, 1) == ':'
- || _dbus_string_get_byte (filename, 0) == '\\'
- || _dbus_string_get_byte (filename, 0) == '/';
- else
- return FALSE;
-}
-
/** @} */ /* End of DBusInternalsUtils functions */
/**