diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2005-02-05 02:36:54 +0100 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 23:24:19 -0700 |
commit | 9172c95c77e8f1377b6c8becc84995e6e28a61eb (patch) | |
tree | ecc549e85a5669c5180885ccd7e9aeb84e0ce027 /extras/chassis_id/table.c | |
parent | 61599bdd06b059e7a5792b0417828d0a87541038 (diff) |
[PATCH] chassis_id: clean compilation and fix bad function parameter passing
Adding prototypes for functions resulted in an error, cause:
table_find_disk(disk_snum, &chassis_num, &slot_num);
is called but the function is defined as:
int table_find_disk(char *serialnumber , int *host_num, int *chassis_num, int *slot_num)
which can obviously not work correctly.
Using popen() is not klibc compatible, so skip the compilation if
a klibc compile is requested.
Diffstat (limited to 'extras/chassis_id/table.c')
-rw-r--r-- | extras/chassis_id/table.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/extras/chassis_id/table.c b/extras/chassis_id/table.c index f4689ae243..8d14cd1b59 100644 --- a/extras/chassis_id/table.c +++ b/extras/chassis_id/table.c @@ -18,10 +18,13 @@ * Boston, MA 021110-1307, USA. * * Authors: Atul Sabharwal - * + * */ #include <stdio.h> +#include <string.h> + +#include "chassis_id.h" #define TABLE_SIZE 100 #define PROVISION_DB "/usr/local/bin/provision.tbl" @@ -40,7 +43,7 @@ int ptable_size; /* Initialize the provisioning table by reading the data from special file provision.tbl * Return error if something does not work appropriately. */ -int table_init() +int table_init(void) { FILE *fp; char ptr[255]; @@ -70,7 +73,7 @@ int table_init() /* return -1 when no disk found. Otherwise return index of disk */ -int table_find_disk( char * serialnumber , int * host_num, int * chassis_num, int *slot_num) +int table_find_disk(const char *serialnumber , int *chassis_num, int *slot_num) { int i; @@ -92,10 +95,12 @@ int table_find_disk( char * serialnumber , int * host_num, int * chassis_num, in * so that it can create descriptive GDN for it. So, for that we need to output * this data to stdout. */ -int table_select_disk( int diskindex ) +int table_select_disk(int diskindex) { printf("%d ", ptable[diskindex].chassis_num); printf("%d ", ptable[diskindex].slot_num); printf("%s ", ptable[diskindex].name); + + return 0; } |