patch-src_digitemp_c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. --- digitemp-3.6.0.orig/src/digitemp.c 2008-08-28 06:42:48.000000000 +0200
  2. +++ digitemp-3.6.0/src/digitemp.c 2009-06-12 21:29:17.000000000 +0200
  3. @@ -62,9 +62,7 @@
  4. #include <stdlib.h>
  5. #include <ctype.h>
  6. #include <unistd.h>
  7. -#if !defined(AIX) && !defined(SOLARIS) && !defined(FREEBSD) && !defined(DARWIN)
  8. #include <getopt.h>
  9. -#endif /* !AIX and !SOLARIS and !FREEBSD and !DARWIN */
  10. #include <sys/types.h>
  11. #include <sys/stat.h>
  12. #include <sys/time.h>
  13. @@ -75,24 +73,11 @@
  14. #include <stdint.h>
  15. #include "ad26.h"
  16. -// Include endian.h
  17. -#if DARWIN
  18. -#include <machine/endian.h>
  19. -#endif
  20. -#if FREEBSD
  21. -#include <sys/endian.h>
  22. -#endif
  23. -#if !defined(DARWIN) && !defined(FREEBSD)
  24. -#include <endian.h>
  25. -#endif
  26. -
  27. -#ifdef LINUX
  28. #ifndef OWUSB
  29. #ifdef LOCKDEV
  30. #include <lockdev.h>
  31. #endif
  32. #endif
  33. -#endif
  34. #include "digitemp.h"
  35. #include "device_name.h"
  36. @@ -101,51 +86,8 @@
  37. /* Setup the correct getopt starting point */
  38. -#ifdef LINUX
  39. #define GETOPTEOF -1
  40. #define OPTINDSTART 0
  41. -#endif
  42. -
  43. -#ifdef CYGWIN
  44. -#define GETOPTEOF -1
  45. -#define OPTINDSTART 0
  46. -#endif
  47. -
  48. -#ifdef AIX
  49. -#define OPTINDSTART 0
  50. -#define GETOPTEOF 255
  51. -#endif
  52. -
  53. -#ifdef SOLARIS
  54. -#define GETOPTEOF EOF
  55. -#define OPTINDSTART 1
  56. -#endif
  57. -
  58. -#ifdef FREEBSD
  59. -#define GETOPTEOF EOF
  60. -#define OPTINDSTART 1
  61. -#endif
  62. -
  63. -#ifdef OPENBSD
  64. -#define GETOPTEOF EOF
  65. -#define OPTINDSTART 1
  66. -#endif
  67. -
  68. -#ifdef NETBSD
  69. -#define GETOPTEOF EOF
  70. -#define OPTINDSTART 1
  71. -#endif
  72. -
  73. -#ifdef DARWIN
  74. -#define GETOPTEOF EOF
  75. -#define OPTINDSTART 1
  76. -#endif
  77. -
  78. -#ifdef OTHER
  79. -#define GETOPTEOF EOF
  80. -#define OPTINDSTART 1
  81. -#endif
  82. -
  83. /* For tracking down strange errors */
  84. #undef BCL_DEBUG
  85. @@ -153,10 +95,6 @@
  86. extern char *optarg;
  87. extern int optind, opterr, optopt;
  88. -#if defined(FREEBSD) || defined(DARWIN)
  89. -extern int optreset;
  90. -#endif /* FREEBSD or DARWIN */
  91. -
  92. extern const char dtlib[]; /* Library Used */
  93. char serial_port[40], /* Path to the serial port */
  94. @@ -1928,7 +1866,7 @@ int Walk1Wire()
  95. struct _roms coupler_list; /* Attached Roms */
  96. int x;
  97. - bzero( &coupler_list, sizeof( struct _roms ) );
  98. + memset( &coupler_list, 0, sizeof( struct _roms ) );
  99. /* Find any DS2409 Couplers and turn them all off.
  100. This WILL NOT WORK if there is a coupler attached to the
  101. @@ -2427,7 +2365,7 @@ int main( int argc, char *argv[] )
  102. /* Make sure the structure is erased */
  103. - bzero( &sensor_list, sizeof( struct _roms ) );
  104. + memset( &sensor_list, 0, sizeof( struct _roms ) );
  105. if( argc <= 1 )