libdasd: Provide definition for bus id size

dasdview and libdasd deal with DASD bus ids and should use a definition
for the size. libu2s already provides a definition, which is used by
dasdview. However, the size of 32 is a bit much and the definition
should be part of libdasd.

Including the terminating null byte ('\0') and considering a DASD bus id
length of 8 characters (e.g. 0.0.4711), this leads to a size of 9.

Provide such a definition via libdasd and update any user.

Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Jan Höppner
2019-04-03 16:33:39 +02:00
parent 8c06dea4e5
commit ab510cff39
3 changed files with 7 additions and 4 deletions
+3 -2
View File
@@ -12,6 +12,7 @@
#include <errno.h>
#include <stdlib.h>
#include "lib/dasd_base.h"
#include "lib/dasd_sys.h"
#include "lib/util_path.h"
@@ -32,7 +33,7 @@
*/
int dasd_sys_raw_track_access(char *devnode)
{
char busid[9];
char busid[DASD_BUS_ID_SIZE];
char *path;
FILE *fp;
int rc;
@@ -108,7 +109,7 @@ int dasd_get_pm_from_chpid(char *busid, unsigned int chpid, int *mask)
int dasd_reset_chpid(char *devnode, char *chpid_char)
{
unsigned int chpid;
char busid[9];
char busid[DASD_BUS_ID_SIZE];
int mask, rc;
char *endptr;
char *path;