ports/72642: [ maintainer ] sysutils/torsmo: various fixes

Roman Bogorodskiy bogorodskiy at inbox.ru
Wed Oct 13 14:00:51 UTC 2004


>Number:         72642
>Category:       ports
>Synopsis:       [ maintainer ] sysutils/torsmo: various fixes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 13 14:00:50 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Roman Bogorodskiy
>Release:        FreeBSD 5.3-BETA7 i386
>Organization:
>Environment:
System: FreeBSD lame.novel.ru 5.3-BETA7 FreeBSD 5.3-BETA7 #11: Sun Oct 10 18:12:32 MSD 2004 root at lame.novel.ru:/usr/obj/usr/home/novel/current/src/sys/NOVEL i386


>Description:
	There are some fixes sent by Stasys Smailys:
		- use size_t insead of int to get uptime in a 
		  correct way on amd64
		- fix wrong type cast for get_acpi_temperature()
		- set optreset to 1 before the second call to getopt()	

>How-To-Repeat:
	
>Fix:

diff -ruN torsmo.orig/Makefile torsmo/Makefile
--- torsmo.orig/Makefile	Wed Oct 13 17:26:27 2004
+++ torsmo/Makefile	Wed Oct 13 17:41:08 2004
@@ -7,6 +7,7 @@
 
 PORTNAME=	torsmo
 PORTVERSION=	0.17
+PORTREVISION=	1
 CATEGORIES=	sysutils
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
diff -ruN torsmo.orig/files/freebsd.c torsmo/files/freebsd.c
--- torsmo.orig/files/freebsd.c	Wed Oct 13 17:26:27 2004
+++ torsmo/files/freebsd.c	Wed Oct 13 17:27:21 2004
@@ -94,7 +94,7 @@
 	int mib[2] = {CTL_KERN, KERN_BOOTTIME};
       	struct timeval boottime;
         time_t now;
-	int size = sizeof(boottime);
+	size_t size = sizeof(boottime);
 	double uptime;
 
 	if((sysctl(mib, 2, &boottime, &size, NULL, 0) != -1) && (boottime.tv_sec != 0)) {
diff -ruN torsmo.orig/files/patch-torsmo.c torsmo/files/patch-torsmo.c
--- torsmo.orig/files/patch-torsmo.c	Wed Oct 13 17:26:27 2004
+++ torsmo/files/patch-torsmo.c	Wed Oct 13 17:37:15 2004
@@ -1,11 +1,41 @@
---- torsmo.c.orig	Thu Aug  5 19:39:06 2004
-+++ torsmo.c	Thu Aug  5 19:39:20 2004
+--- torsmo.c.orig	Wed Oct 13 17:31:57 2004
++++ torsmo.c	Wed Oct 13 17:35:45 2004
+@@ -376,7 +376,7 @@
+       snprintf(buf, 255, "%.1fM", m);
+   }
+   else if (a >= 1024)
+-    snprintf(buf, 255, "%Ldk", a/1024L);
++    snprintf(buf, 255, "%Ldk", a/1024);
+   else
+     snprintf(buf, 255, "%Ld", a);
+ }
 @@ -998,7 +998,7 @@
      }
      OBJ(acpitemp) {
        /* does anyone have decimals in acpi temperature? */
 -      snprintf(p, n, "%d", (int) get_acpi_temperature(obj->data.i));
-+      snprintf(p, n, "%0.1f", (int) get_acpi_temperature(obj->data.i));
++      snprintf(p, n, "%0.1f", (float)get_acpi_temperature(obj->data.i));
      }
      OBJ(acpifan) {
        snprintf(p, n, "%s", get_acpi_fan());
+@@ -2248,8 +2248,8 @@
+ 
+   /* handle other command line arguments */
+ 
+-  optind = 0;
+-
++  optind = optreset = 1;
++  
+   while (1) {
+     int c = getopt(argc, argv, getopt_string);
+     if(c == -1) break;
+@@ -2353,8 +2353,7 @@
+ 
+     default:
+       fprintf(stderr, "torsmo: forked to background, pid is %d\n", ret);
+-      exit(0);
+-      break;
++      return 0;
+     }
+   }
+ 
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list