1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../clockspeed/t2_fixes.patch
5 # Copyright (C) 2004 - 2005 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
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
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
21 conf-cc conf-ld 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`\' \
34 - ./auto-str auto_home `head -1 conf-home` > auto_home.c
35 + ./auto-str auto_home `head -n 1 conf-home` > auto_home.c
39 diff -urN clockspeed-0.62.orig/clockspeed.c clockspeed-0.62/clockspeed.c
40 --- clockspeed-0.62.orig/clockspeed.c 1998-10-13 19:37:49.000000000 +0200
41 +++ clockspeed-0.62/clockspeed.c 2005-02-12 21:15:24.384731032 +0100
43 if (deriv <= 0) return;
44 if (deriv > 200000000) return; /* 5Hz ticks? be serious */
46 - fd = open_trunc("etc/atto.tmp");
47 + fd = open_trunc("/var/state/clockspeed/atto.tmp");
52 if (fsync(fd) == -1) { close(fd); return; }
53 if (close(fd) == -1) return; /* NFS stupidity */
55 - rename("etc/atto.tmp","etc/atto"); /* if it fails, bummer */
56 + rename("/var/state/clockspeed/atto.tmp","/var/state/clockspeed/atto"); /* if it fails, bummer */
61 if (chdir(auto_home) == -1) _exit(1);
64 - if (open_read("etc/atto") == 0) {
65 + if (open_read("/var/state/clockspeed/atto") == 0) {
66 r = read(0,buf,sizeof buf);
72 - if (fifo_make("adjust",0600) == -1) if (errno != error_exist) _exit(1);
73 - if (open_read("adjust") != 0) _exit(1);
74 - if (open_write("adjust") == -1) _exit(1);
75 + if (fifo_make("/var/state/clockspeed/adjust",0600) == -1) if (errno != error_exist) _exit(1);
76 + if (open_read("/var/state/clockspeed/adjust") != 0) _exit(1);
77 + if (open_write("/var/state/clockspeed/adjust") == -1) _exit(1);
81 diff -urN clockspeed-0.62.orig/clockview.c clockspeed-0.62/clockview.c
82 --- clockspeed-0.62.orig/clockview.c 1998-10-13 19:37:49.000000000 +0200
83 +++ clockspeed-0.62/clockview.c 2005-02-12 16:52:25.000000000 +0100
85 #include <sys/types.h>
86 -#include <sys/time.h>
89 #include "readwrite.h"
91 diff -urN clockspeed-0.62.orig/error.h clockspeed-0.62/error.h
92 --- clockspeed-0.62.orig/error.h 1998-10-13 19:37:49.000000000 +0200
93 +++ clockspeed-0.62/error.h 2005-02-12 16:57:50.000000000 +0100
101 extern int error_intr;
102 extern int error_nomem;
103 diff -urN clockspeed-0.62.orig/hier.c clockspeed-0.62/hier.c
104 --- clockspeed-0.62.orig/hier.c 1998-10-13 19:37:49.000000000 +0200
105 +++ clockspeed-0.62/hier.c 2005-02-12 21:54:50.393043096 +0100
110 - c("/","etc","leapsecs.dat",-1,-1,0644);
111 + d("/var/state","clockspeed",-1,-1,0755);
113 + c("/","var/state/clockspeed","leapsecs.dat",-1,-1,0644);
115 h(auto_home,-1,-1,0755);
117 - d(auto_home,"etc",-1,-1,0755);
118 d(auto_home,"bin",-1,-1,0755);
119 d(auto_home,"man",-1,-1,0755);
120 d(auto_home,"man/man1",-1,-1,0755);
121 diff -urN clockspeed-0.62.orig/leapsecs_read.c clockspeed-0.62/leapsecs_read.c
122 --- clockspeed-0.62.orig/leapsecs_read.c 1998-10-13 19:37:49.000000000 +0200
123 +++ clockspeed-0.62/leapsecs_read.c 2005-02-12 21:28:04.674149472 +0100
125 #include <sys/stat.h>
130 #include "leapsecs.h"
136 - fd = open("/etc/leapsecs.dat",O_RDONLY | O_NDELAY);
137 + fd = open("/var/state/clockspeed/leapsecs.dat",O_RDONLY | O_NDELAY);
139 if (errno != ENOENT) return -1;
140 if (leapsecs) free(leapsecs);