X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=misc%2Fbase_device.c;h=aad2ba0581de2c24cc7521a38a14336126ca3268;hb=829d9994880394e48c883510799b1536812d6efb;hp=f58f2e87f40df2059634a1799ff05820a1fd4621;hpb=b9fd8c1fdbe0b118e29494366c9aac0545c8e1fe;p=tools%2Fe2fsprogs.git diff --git a/misc/base_device.c b/misc/base_device.c index f58f2e8..aad2ba0 100644 --- a/misc/base_device.c +++ b/misc/base_device.c @@ -5,12 +5,12 @@ * assure that we only fsck one partition on a particular drive at any * one time. Otherwise, the disk heads will be seeking all over the * place. If the base device can not be determined, return NULL. - * + * * The base_device() function returns an allocated string which must * be freed. - * + * * Written by Theodore Ts'o, - * + * * Copyright (C) 2000 Theodore Ts'o. * * %Begin-Header% @@ -38,7 +38,7 @@ static const char *devfs_hier[] = { "host", "bus", "target", "lun", 0 }; -char *base_device(char *device) +char *base_device(const char *device) { char *str, *cp; const char **hier, *disk; @@ -58,7 +58,7 @@ char *base_device(char *device) /* Skip over /dev/dsk/... */ if (strncmp(cp, "dsk/", 4) == 0) cp += 4; - + /* * For md devices, we treat them all as if they were all * on one disk, since we don't know how to parallelize them. @@ -147,8 +147,7 @@ errout: } #ifdef DEBUG - -main(int argc, char** argv) +int main(int argc, char** argv) { const char *base; char buf[256], *cp; @@ -167,5 +166,4 @@ main(int argc, char** argv) } exit(0); } - #endif