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.
73 lines
2.5 KiB
73 lines
2.5 KiB
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
# |
|
# Filename: package/.../clockspeed/0005-use-localstatedir.patch |
|
# Copyright (C) 2011 The OpenSDE 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. |
|
# --- SDE-COPYRIGHT-NOTE-END --- |
|
|
|
From c07880a1f68386eedfa63d114ebd785dd341ac6e Mon Sep 17 00:00:00 2001 |
|
From: Christian Wiese <christian.wiese@securepoint.de> |
|
Date: Thu, 29 Sep 2011 14:29:52 +0200 |
|
Subject: [PATCH 5/6] change directory for adjust fifo, atto and leapsecs.dat file from /etc -> /var/state/clockspeed |
|
|
|
--- |
|
clockspeed.c | 12 ++++++------ |
|
hier.c | 5 +++-- |
|
leapsecs_read.c | 2 +- |
|
3 files changed, 10 insertions(+), 9 deletions(-) |
|
|
|
diff --git a/clockspeed.c b/clockspeed.c |
|
index 18a7383..ec425bf 100644 |
|
--- a/clockspeed.c |
|
+++ b/clockspeed.c |
|
@@ -83,7 +83,7 @@ void savederiv() |
|
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 @@ void savederiv() |
|
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 @@ void main() |
|
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); |
|
|
|
-- |
|
1.6.6.2 |
|
|
|
|