From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Jan 17 08:40:22 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 23B2B16A4CE for ; Sat, 17 Jan 2004 08:40:22 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 58FED43D2F for ; Sat, 17 Jan 2004 08:40:17 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i0HGeHFR094817 for ; Sat, 17 Jan 2004 08:40:17 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i0HGeHsP094816; Sat, 17 Jan 2004 08:40:17 -0800 (PST) (envelope-from gnats) Resent-Date: Sat, 17 Jan 2004 08:40:17 -0800 (PST) Resent-Message-Id: <200401171640.i0HGeHsP094816@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Radim Kolar Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B9D6316A4CE for ; Sat, 17 Jan 2004 08:30:35 -0800 (PST) Received: from mail.tiscali.cz (stateless2.tiscali.cz [213.235.135.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id 04B6F43D49 for ; Sat, 17 Jan 2004 08:30:34 -0800 (PST) (envelope-from hsn@netmag.cz) Received: from asura.bsd (212.11.96.229) by mail.tiscali.cz (6.7.018) id 3FB9680901159853 for FreeBSD-gnats-submit@freebsd.org; Sat, 17 Jan 2004 17:30:32 +0100 Received: from hsn by asura.bsd with local (Exim 4.24 #4 (Debian)) id 1AhbyH-0001td-Ng for ; Fri, 16 Jan 2004 22:57:41 +0100 Message-Id: Date: Fri, 16 Jan 2004 22:57:41 +0100 From: Radim Kolar To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/61479: [patch] fix for uptimed X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Radim Kolar List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2004 16:40:22 -0000 >Number: 61479 >Category: ports >Synopsis: [patch] fix for uptimed >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jan 17 08:40:16 PST 2004 >Closed-Date: >Last-Modified: >Originator: Radim Kolar >Release: FreeBSD 5.2-RELEASE i386 >Organization: Sanatana Dharma >Environment: System: FreeBSD asura.bsd 5.2-RELEASE FreeBSD 5.2-RELEASE #0: Thu Jan 15 18:35:03 CET 2004 root@asura.bsd:/usr/obj/usr/src/sys/GENERIC i386 >Description: When system crashes while uptimed is updating his record file, all entries in the file are lost. This simple patch writes records into temporary file and rename it to original. Tested and works. >How-To-Repeat: Press reset button while uptimed is running, if you are lucky, softupdates sets file length to zero. It happens to me 2 times on linux with reiserfs journaling and 3 times on freebsd with softupdates. >Fix: diff -rNu /usr/ports/sysutils/uptimed/Makefile /tmp/uptimed/Makefile --- /usr/ports/sysutils/uptimed/Makefile Fri Feb 21 14:28:55 2003 +++ /tmp/uptimed/Makefile Fri Jan 16 22:40:59 2004 @@ -6,6 +6,7 @@ PORTNAME= uptimed PORTVERSION= 0.3.0 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= uptimed diff -rNu /usr/ports/sysutils/uptimed/files/patch-aa /tmp/uptimed/files/patch-aa --- /usr/ports/sysutils/uptimed/files/patch-aa Thu Jan 1 01:00:00 1970 +++ /tmp/uptimed/files/patch-aa Fri Jan 16 22:43:09 2004 @@ -0,0 +1,19 @@ +--- libuptimed/urec.c.orig Tue Nov 5 12:41:04 2002 ++++ libuptimed/urec.c Fri Jan 16 22:42:30 2004 +@@ -246,7 +246,7 @@ + Urec *u; + int i=0; + +- f=fopen(FILE_RECORDS, "w"); ++ f=fopen(FILE_RECORDS".new", "w"); + if (!f) + { + printf("uptimed: cannot write to %s\n", FILE_RECORDS); +@@ -265,6 +265,7 @@ + } + } + fclose(f); ++ rename(FILE_RECORDS".new",FILE_RECORDS); + } + + #ifdef PLATFORM_LINUX >Release-Note: >Audit-Trail: >Unformatted: