initial windows patch

Ralf Habacker ralf.habacker at freenet.de
Tue Jul 25 05:16:08 PDT 2006


Hi all,

relating to the patches Peter has send and to Havocs comments

>> +#ifndef DBUS_WIN
>>  #include <unistd.h>
>> +#endif

>If unistd is not used in the file, this should just be deleted; if it
>is, then there's more thinking to do (depends on how it's used).

>> +#ifdef DBUS_WIN
>> +      const char *p = _dbus_getenv ("DBUS_VERBOSE");
>> +      verbose = p != NULL && *p == '1';
>> +#else
>>        verbose = _dbus_getenv ("DBUS_VERBOSE") != NULL;
>> +#endif

>Why not just add the *p == 1 to unix also and drop the #ifdef

I've appended an updated patch. A related changelog entry is appended
below. I have tried to follow the examples in
http://dbus.freedesktop.org/doc/ChangeLog

changelog entry:

	* dbus/dbus-internals.c: (_dbus_verbose_real): only enable
        verbose printing if DBUS_VERBOSE environment var is set to '1'

	* dbus/dbus-internals.c: removed unused unistd.h header


Regards
Ralf



-------------- next part --------------
Index: dbus/dbus-internals.c
===================================================================
--- dbus/dbus-internals.c	(revision 45)
+++ dbus/dbus-internals.c	(working copy)
@@ -28,7 +28,6 @@
 #include <string.h>
 #include <sys/types.h>
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <stdlib.h>
 
@@ -246,7 +245,8 @@
   
   if (!verbose_initted)
     {
-      verbose = _dbus_getenv ("DBUS_VERBOSE") != NULL;
+      const char *p = _dbus_getenv ("DBUS_VERBOSE"); 
+      verbose = p != NULL && *p == '1';
       verbose_initted = TRUE;
       if (!verbose)
         return;



More information about the dbus mailing list