OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

140 lines
4.6 KiB

  1. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # T2 SDE: package/.../clockspeed/t2_fixes.patch
  5. # Copyright (C) 2004 - 2006 The T2 SDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- T2-COPYRIGHT-NOTE-END ---
  16. diff -urN clockspeed-0.62.orig/Makefile clockspeed-0.62/Makefile
  17. --- clockspeed-0.62.orig/Makefile 1998-10-13 19:37:49.000000000 +0200
  18. +++ clockspeed-0.62/Makefile 2005-02-12 16:49:11.000000000 +0100
  19. @@ -7,8 +7,8 @@
  20. auto-ccld.sh: \
  21. conf-cc conf-ld warn-auto.sh
  22. ( cat warn-auto.sh; \
  23. - echo CC=\'`head -1 conf-cc`\'; \
  24. - echo LD=\'`head -1 conf-ld`\' \
  25. + echo CC=\'`head -n 1 conf-cc`\'; \
  26. + echo LD=\'`head -n 1 conf-ld`\' \
  27. ) > auto-ccld.sh
  28. auto-str: \
  29. @@ -21,7 +21,7 @@
  30. auto_home.c: \
  31. auto-str conf-home
  32. - ./auto-str auto_home `head -1 conf-home` > auto_home.c
  33. + ./auto-str auto_home `head -n 1 conf-home` > auto_home.c
  34. auto_home.o: \
  35. compile auto_home.c
  36. diff -urN clockspeed-0.62.orig/clockspeed.c clockspeed-0.62/clockspeed.c
  37. --- clockspeed-0.62.orig/clockspeed.c 1998-10-13 19:37:49.000000000 +0200
  38. +++ clockspeed-0.62/clockspeed.c 2005-02-12 21:15:24.384731032 +0100
  39. @@ -83,7 +83,7 @@
  40. if (deriv <= 0) return;
  41. if (deriv > 200000000) return; /* 5Hz ticks? be serious */
  42. - fd = open_trunc("etc/atto.tmp");
  43. + fd = open_trunc("/var/state/clockspeed/atto.tmp");
  44. if (fd == -1) return;
  45. buf[0] = 0;
  46. @@ -119,7 +119,7 @@
  47. if (fsync(fd) == -1) { close(fd); return; }
  48. if (close(fd) == -1) return; /* NFS stupidity */
  49. - rename("etc/atto.tmp","etc/atto"); /* if it fails, bummer */
  50. + rename("/var/state/clockspeed/atto.tmp","/var/state/clockspeed/atto"); /* if it fails, bummer */
  51. }
  52. void main()
  53. @@ -136,16 +136,16 @@
  54. if (chdir(auto_home) == -1) _exit(1);
  55. umask(033);
  56. - if (open_read("etc/atto") == 0) {
  57. + if (open_read("/var/state/clockspeed/atto") == 0) {
  58. r = read(0,buf,sizeof buf);
  59. if (r == sizeof buf)
  60. deriv = nano(buf);
  61. close(0);
  62. }
  63. - if (fifo_make("adjust",0600) == -1) if (errno != error_exist) _exit(1);
  64. - if (open_read("adjust") != 0) _exit(1);
  65. - if (open_write("adjust") == -1) _exit(1);
  66. + if (fifo_make("/var/state/clockspeed/adjust",0600) == -1) if (errno != error_exist) _exit(1);
  67. + if (open_read("/var/state/clockspeed/adjust") != 0) _exit(1);
  68. + if (open_write("/var/state/clockspeed/adjust") == -1) _exit(1);
  69. now(&first);
  70. diff -urN clockspeed-0.62.orig/clockview.c clockspeed-0.62/clockview.c
  71. --- clockspeed-0.62.orig/clockview.c 1998-10-13 19:37:49.000000000 +0200
  72. +++ clockspeed-0.62/clockview.c 2005-02-12 16:52:25.000000000 +0100
  73. @@ -1,5 +1,5 @@
  74. #include <sys/types.h>
  75. -#include <sys/time.h>
  76. +#include <time.h>
  77. #include "substdio.h"
  78. #include "readwrite.h"
  79. #include "strerr.h"
  80. diff -urN clockspeed-0.62.orig/error.h clockspeed-0.62/error.h
  81. --- clockspeed-0.62.orig/error.h 1998-10-13 19:37:49.000000000 +0200
  82. +++ clockspeed-0.62/error.h 2005-02-12 16:57:50.000000000 +0100
  83. @@ -1,7 +1,7 @@
  84. #ifndef ERROR_H
  85. #define ERROR_H
  86. -extern int errno;
  87. +#include <errno.h>
  88. extern int error_intr;
  89. extern int error_nomem;
  90. diff -urN clockspeed-0.62.orig/hier.c clockspeed-0.62/hier.c
  91. --- clockspeed-0.62.orig/hier.c 1998-10-13 19:37:49.000000000 +0200
  92. +++ clockspeed-0.62/hier.c 2005-02-12 21:54:50.393043096 +0100
  93. @@ -2,11 +2,12 @@
  94. void hier()
  95. {
  96. - c("/","etc","leapsecs.dat",-1,-1,0644);
  97. + d("/var/state","clockspeed",-1,-1,0755);
  98. +
  99. + c("/","var/state/clockspeed","leapsecs.dat",-1,-1,0644);
  100. h(auto_home,-1,-1,0755);
  101. - d(auto_home,"etc",-1,-1,0755);
  102. d(auto_home,"bin",-1,-1,0755);
  103. d(auto_home,"man",-1,-1,0755);
  104. d(auto_home,"man/man1",-1,-1,0755);
  105. diff -urN clockspeed-0.62.orig/leapsecs_read.c clockspeed-0.62/leapsecs_read.c
  106. --- clockspeed-0.62.orig/leapsecs_read.c 1998-10-13 19:37:49.000000000 +0200
  107. +++ clockspeed-0.62/leapsecs_read.c 2005-02-12 21:28:04.674149472 +0100
  108. @@ -2,7 +2,6 @@
  109. #include <sys/stat.h>
  110. #include <fcntl.h>
  111. #include <errno.h>
  112. -extern int errno;
  113. #include "tai.h"
  114. #include "leapsecs.h"
  115. @@ -18,7 +17,7 @@
  116. int i;
  117. struct tai u;
  118. - fd = open("/etc/leapsecs.dat",O_RDONLY | O_NDELAY);
  119. + fd = open("/var/state/clockspeed/leapsecs.dat",O_RDONLY | O_NDELAY);
  120. if (fd == -1) {
  121. if (errno != ENOENT) return -1;
  122. if (leapsecs) free(leapsecs);