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

# --- T2-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# T2 SDE: package/.../clockspeed/t2_fixes.patch
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- T2-COPYRIGHT-NOTE-END ---
diff -urN clockspeed-0.62.orig/Makefile clockspeed-0.62/Makefile
--- clockspeed-0.62.orig/Makefile 1998-10-13 19:37:49.000000000 +0200
+++ clockspeed-0.62/Makefile 2005-02-12 16:49:11.000000000 +0100
@@ -7,8 +7,8 @@
auto-ccld.sh: \
conf-cc conf-ld warn-auto.sh
( cat warn-auto.sh; \
- echo CC=\'`head -1 conf-cc`\'; \
- echo LD=\'`head -1 conf-ld`\' \
+ echo CC=\'`head -n 1 conf-cc`\'; \
+ echo LD=\'`head -n 1 conf-ld`\' \
) > auto-ccld.sh
auto-str: \
@@ -21,7 +21,7 @@
auto_home.c: \
auto-str conf-home
- ./auto-str auto_home `head -1 conf-home` > auto_home.c
+ ./auto-str auto_home `head -n 1 conf-home` > auto_home.c
auto_home.o: \
compile auto_home.c
diff -urN clockspeed-0.62.orig/clockspeed.c clockspeed-0.62/clockspeed.c
--- clockspeed-0.62.orig/clockspeed.c 1998-10-13 19:37:49.000000000 +0200
+++ clockspeed-0.62/clockspeed.c 2005-02-12 21:15:24.384731032 +0100
@@ -83,7 +83,7 @@
if (deriv <= 0) return;
if (deriv > 200000000) return; /* 5Hz ticks? be serious */
- fd = open_trunc("etc/atto.tmp");
+ fd = open_trunc("/var/state/clockspeed/atto.tmp");
if (fd == -1) return;
buf[0] = 0;
@@ -119,7 +119,7 @@
if (fsync(fd) == -1) { close(fd); return; }
if (close(fd) == -1) return; /* NFS stupidity */
- rename("etc/atto.tmp","etc/atto"); /* if it fails, bummer */
+ rename("/var/state/clockspeed/atto.tmp","/var/state/clockspeed/atto"); /* if it fails, bummer */
}
void main()
@@ -136,16 +136,16 @@
if (chdir(auto_home) == -1) _exit(1);
umask(033);
- if (open_read("etc/atto") == 0) {
+ if (open_read("/var/state/clockspeed/atto") == 0) {
r = read(0,buf,sizeof buf);
if (r == sizeof buf)
deriv = nano(buf);
close(0);
}
- if (fifo_make("adjust",0600) == -1) if (errno != error_exist) _exit(1);
- if (open_read("adjust") != 0) _exit(1);
- if (open_write("adjust") == -1) _exit(1);
+ if (fifo_make("/var/state/clockspeed/adjust",0600) == -1) if (errno != error_exist) _exit(1);
+ if (open_read("/var/state/clockspeed/adjust") != 0) _exit(1);
+ if (open_write("/var/state/clockspeed/adjust") == -1) _exit(1);
now(&first);
diff -urN clockspeed-0.62.orig/clockview.c clockspeed-0.62/clockview.c
--- clockspeed-0.62.orig/clockview.c 1998-10-13 19:37:49.000000000 +0200
+++ clockspeed-0.62/clockview.c 2005-02-12 16:52:25.000000000 +0100
@@ -1,5 +1,5 @@
#include <sys/types.h>
-#include <sys/time.h>
+#include <time.h>
#include "substdio.h"
#include "readwrite.h"
#include "strerr.h"
diff -urN clockspeed-0.62.orig/error.h clockspeed-0.62/error.h
--- clockspeed-0.62.orig/error.h 1998-10-13 19:37:49.000000000 +0200
+++ clockspeed-0.62/error.h 2005-02-12 16:57:50.000000000 +0100
@@ -1,7 +1,7 @@
#ifndef ERROR_H
#define ERROR_H
-extern int errno;
+#include <errno.h>
extern int error_intr;
extern int error_nomem;
diff -urN clockspeed-0.62.orig/hier.c clockspeed-0.62/hier.c
--- clockspeed-0.62.orig/hier.c 1998-10-13 19:37:49.000000000 +0200
+++ clockspeed-0.62/hier.c 2005-02-12 21:54:50.393043096 +0100
@@ -2,11 +2,12 @@
void hier()
{
- c("/","etc","leapsecs.dat",-1,-1,0644);
+ d("/var/state","clockspeed",-1,-1,0755);
+
+ c("/","var/state/clockspeed","leapsecs.dat",-1,-1,0644);
h(auto_home,-1,-1,0755);
- d(auto_home,"etc",-1,-1,0755);
d(auto_home,"bin",-1,-1,0755);
d(auto_home,"man",-1,-1,0755);
d(auto_home,"man/man1",-1,-1,0755);
diff -urN clockspeed-0.62.orig/leapsecs_read.c clockspeed-0.62/leapsecs_read.c
--- clockspeed-0.62.orig/leapsecs_read.c 1998-10-13 19:37:49.000000000 +0200
+++ clockspeed-0.62/leapsecs_read.c 2005-02-12 21:28:04.674149472 +0100
@@ -2,7 +2,6 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
-extern int errno;
#include "tai.h"
#include "leapsecs.h"
@@ -18,7 +17,7 @@
int i;
struct tai u;
- fd = open("/etc/leapsecs.dat",O_RDONLY | O_NDELAY);
+ fd = open("/var/state/clockspeed/leapsecs.dat",O_RDONLY | O_NDELAY);
if (fd == -1) {
if (errno != ENOENT) return -1;
if (leapsecs) free(leapsecs);