cvs commit: patches/procinfo procinfo-18-install-1.patch procinfo-18-perl-1.patch procinfo-18-uptime-1.patch

jim at linuxfromscratch.org jim at linuxfromscratch.org
Sun Oct 5 15:13:20 PDT 2003


jim         03/10/05 16:13:20

  Added:       procinfo procinfo-18-install-1.patch
                        procinfo-18-perl-1.patch procinfo-18-uptime-1.patch
  Log:
  Added: procinfo patches install perl uptime
  
  Revision  Changes    Path
  1.1                  patches/procinfo/procinfo-18-install-1.patch
  
  Index: procinfo-18-install-1.patch
  ===================================================================
  Submitted By: Jim Gifford (patches at jg555 dot com)
  Date: 2003-09-13
  Initial Package Version: 18
  Origin: Rawhide
  Description: Better Installation Routine
  
  diff -Naur procinfo-18.orig/Makefile procinfo-18/Makefile
  --- procinfo-18.orig/Makefile	2001-02-24 23:29:53.000000000 +0000
  +++ procinfo-18/Makefile	2003-09-13 07:31:24.000000000 +0000
  @@ -1,6 +1,7 @@
   ### Makefile for procinfo.
   
   prefix=/usr
  +mandir=$(prefix)/man
   
   CC = gcc -Wall -Wstrict-prototypes
   
  @@ -33,13 +34,13 @@
   
   install: procinfo procinfo.8 lsdev.pl socklist.pl lsdev.8
   	-mkdir -p $(prefix)/bin
  -	install procinfo $(prefix)/bin/procinfo
  -	install lsdev.pl $(prefix)/bin/lsdev
  -	install socklist.pl $(prefix)/bin/socklist
  -	-mkdir -p $(prefix)/man/man8
  -	install -m 644  procinfo.8 $(prefix)/man/man8/procinfo.8
  -	install -m 644  lsdev.8 $(prefix)/man/man8/lsdev.8
  -	install -m 644  socklist.8 $(prefix)/man/man8/socklist.8
  +	install -m 755 procinfo $(prefix)/bin/procinfo
  +	install -m 755 lsdev.pl $(prefix)/bin/lsdev
  +	install -m 755 socklist.pl $(prefix)/bin/socklist
  +	-mkdir -p $(mandir)
  +	install -m 644  procinfo.8 $(mandir)/man8/procinfo.8
  +	install -m 644  lsdev.8 $(mandir)/man8/lsdev.8
  +	install -m 644  socklist.8 $(mandir)/man8/socklist.8
   
   clean:
   	rm -f procinfo procinfo.0 *.o *~ out
  
  
  
  1.1                  patches/procinfo/procinfo-18-perl-1.patch
  
  Index: procinfo-18-perl-1.patch
  ===================================================================
  Submitted By: Jim Gifford (patches at jg555 dot com)
  Date: 2003-09-13
  Initial Package Version: 18
  Origin: Rawhide
  Description: Fixes minor Perl Formatting Error.
  
  diff -Naur procinfo-18.orig/lsdev.pl procinfo-18/lsdev.pl
  --- procinfo-18.orig/lsdev.pl	2001-02-24 23:30:52.000000000 +0000
  +++ procinfo-18/lsdev.pl	2003-09-13 07:27:38.000000000 +0000
  @@ -16,6 +16,7 @@
   while (<IRQ>) {
       next if /^[ \t]*[A-Z]/;
       chop;
  +    s/^ +//g;
       if (/PIC/) {
   	$n = (@line = split());
       } else {
  @@ -32,6 +33,7 @@
   open (DMA, "</proc/dma") || die "can't open /proc/dma";
   while (<DMA>) {
       chop;
  +    s/^ +//g;
       @line = split(': ');
       @tmp = split (/[ \(]/, $line[1]);
       $name = $tmp[0];
  @@ -43,6 +45,7 @@
   open (IOPORTS, "</proc/ioports") || die "can't open /proc/ioports";
   while (<IOPORTS>) {
       chop;
  +    s/^ +//g;
       @line = split(' : ');
       @tmp = split (/[ \(]/, $line[1]);
       $name = $tmp[0];
  @@ -51,12 +54,12 @@
   }
   close (IOPORTS);
   
  -printf ("%-16s %4s%6s %s\n------------------------------------------------\n",
  -	"Device", "DMA", "IRQ", " I/O Ports");
  +printf "%-16s %4s%6s %s\n------------------------------------------------\n",
  +	"Device", "DMA", "IRQ", " I/O Ports";
   
   foreach $name (sort { uc($a) cmp uc($b) } keys %device) {
  -    printf ("%-16s %4s%6s %s\n",
  -	    $name, $dma{$name}, $irq{$name}, $port{$name});
  +    printf "%-16s %4s%6s %s\n",
  +	    $name, $dma{$name}, $irq{$name}, $port{$name};
   }
   
   # The End ####################################################################
  
  
  
  1.1                  patches/procinfo/procinfo-18-uptime-1.patch
  
  Index: procinfo-18-uptime-1.patch
  ===================================================================
  Submitted By: Jim Gifford (patches at jg555 dot com)
  Date: 2003-09-13
  Initial Package Version: 18
  Origin: Rawhide
  Description: Better Uptime Calculations
  
  diff -Naur procinfo-18.orig/routines.c procinfo-18/routines.c
  --- procinfo-18.orig/routines.c	2001-02-24 23:30:45.000000000 +0000
  +++ procinfo-18/routines.c	2003-09-13 07:33:12.000000000 +0000
  @@ -390,19 +390,19 @@
       unsigned int d, h, m, s;
       static char buf[22];
   
  -    t = t * 100 / HZ;
  -    d = (int) (t / 8640000);
  -    t = t - (long) (d * 8640000);
  -    h = (int) (t / 360000);
  -    t = t - (long) (h * 360000);
  -    m = (int) (t / 6000);
  -    t = t - (long) (m * 6000);
  -    s = (int) (t / 100);
  -    t = t - (long) (s * 100);
  +    t *= (100 / HZ);
  +    d = (unsigned int) (t / 8640000);
  +    t -= (unsigned long) (d * 8640000);
  +    h = (unsigned int) (t / 360000);
  +    t -= (unsigned long) (h * 360000);
  +    m = (unsigned int) (t / 6000);
  +    t -= (unsigned long) (m * 6000);
  +    s = (unsigned int) (t / 100);
  +    t -= (unsigned long) (s * 100);
       if (d > 0)
  -	sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (int) t);
  +	sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (unsigned int) t);
       else
  -	sprintf (buf, "     %2u:%02u:%02u.%02u", h, m, s, (int) t);
  +	sprintf (buf, "     %2u:%02u:%02u.%02u", h, m, s, (unsigned int) t);
       return buf;
   }
   
  
  
  



More information about the patches mailing list