]> granicus.if.org Git - procps-ng/commitdiff
misc
authoralbert <>
Sat, 16 Aug 2003 21:15:53 +0000 (21:15 +0000)
committeralbert <>
Sat, 16 Aug 2003 21:15:53 +0000 (21:15 +0000)
proc/ksym.c
ps/sortformat.c
skill.c
vmstat.c

index bf1d6358296d26a58d3c12fc2262885ac7feb93f..48ccc1fb259c20adf351ab0a4288fe6c7a5219e6 100644 (file)
@@ -547,7 +547,7 @@ int open_psdb(const char *restrict override) {
 
 /***************************************/
 
-const char * read_wchan_file(unsigned pid){
+static const char * read_wchan_file(unsigned pid){
   static char buf[64];
   const char *ret = buf;
   ssize_t num;
@@ -565,6 +565,8 @@ const char * read_wchan_file(unsigned pid){
 
   // would skip over numbers if they existed -- but no
 
+  // lame ppc64 has a '.' in front of every name
+  if(*ret=='.') ret++;
   switch(*ret){
     case 's': if(!strncmp(ret, "sys_", 4)) ret += 4;   break;
     case 'd': if(!strncmp(ret, "do_",  3)) ret += 3;   break;
index 736bea52153ed7d0bc2a89b48ccbc9fdfe83d767..06181c5fbd3a48de3aa085f1bdeac3e6eb15b8bd 100644 (file)
@@ -31,10 +31,6 @@ static int have_gnu_sort = 0;           /* if true, "O" must be format */
 static int already_parsed_sort = 0;     /* redundantly set in & out of fn */
 static int already_parsed_format = 0;
 
-
-#define parse_sort_opt <-- arrgh! do not use this -->
-#define gnusort_parse  <-- arrgh! do not use this -->
-
 #ifndef COL_PIDMAX
 #warning Ugly wart needs fixing, use common.h to sync w/ output.c
 #define COL_PIDMAX 0x20
diff --git a/skill.c b/skill.c
index c4bd7bcaecfd8a42d9363ef0e129345b4b3f0f17..56ac4f171cdbd2e0f6ccecf4030bcf4863454691 100644 (file)
--- a/skill.c
+++ b/skill.c
@@ -56,8 +56,7 @@ static int program;
 
 /********************************************************************/
 
-static void display_kill_version(){
-
+static void display_kill_version(void){
   switch(program) {
     case PROG_KILL:
       fprintf(stdout, "kill (%s)\n",procps_version);
index 8aa82df651f39cefc1e67d0a979140e8114d1efb..2f44724b2de5711bb7eb63b976165b575d5b9a50 100644 (file)
--- a/vmstat.c
+++ b/vmstat.c
@@ -291,13 +291,18 @@ static void new_format(void) {
 ////////////////////////////////////////////////////////////////////////////
 
 static int diskpartition_format(const char* partition_name){
-  FILE *fDiskstat;
-  struct disk_stat *disks;
-  struct partition_stat *partitions, *current_partition=NULL;
-  unsigned long ndisks,i,j,k,npartitions;
-  const char format[]="%20u %10llu %10u %10u\n";
+    FILE *fDiskstat;
+    struct disk_stat *disks;
+    struct partition_stat *partitions, *current_partition=NULL;
+    unsigned long ndisks, j, k, npartitions;
+    const char format[] = "%20u %10llu %10u %10u\n";
+
+    fDiskstat=fopen("/proc/diskstats","rb");
+    if(!fDiskstat){
+        fprintf(stderr, "Your kernel doesn't support diskstat. (2.5.70 or above required)\n"); 
+        exit(0);
+    }
 
-  if ((fDiskstat=fopen("/proc/diskstats", "rb"))){
     fclose(fDiskstat);
     ndisks=getdiskstat(&disks,&partitions);
     npartitions=getpartitions_num(disks, ndisks);
@@ -335,10 +340,7 @@ static int diskpartition_format(const char* partition_name){
         free(disks);
         free(partitions);
     }
- }else{
-    fprintf(stderr, "Your kernel doesn't support diskstat (2.5.70 or above required)"); 
-    exit(0);
- }
+    return 0;
 }
 
 ////////////////////////////////////////////////////////////////////////////