Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH] raw: fix shadowing of minor function
@ 2011-08-29 16:59 maximilian attems
  2011-08-30  9:54 ` Karel Zak
  0 siblings, 1 reply; 3+ messages in thread
From: maximilian attems @ 2011-08-29 16:59 UTC (permalink / raw)
  To: util-linux; +Cc: maximilian attems

Noticed while compiling against klibc:
raw.c: In function ‘query’:
raw.c:219:16: error: called object ‘minor’ is not a function

Rename variable from minor to minor_raw.
While at it mark the functions as static and small whitespace fixes
as asked by checkpatch.

Signed-off-by: maximilian attems <max@stro.at>
---
 disk-utils/raw.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/disk-utils/raw.c b/disk-utils/raw.c
index c2c1a3e..88f2211 100644
--- a/disk-utils/raw.c
+++ b/disk-utils/raw.c
@@ -40,8 +40,8 @@ int	master_fd;
 int	raw_minor;
 
 void open_raw_ctl(void);
-int  query(int minor, const char *raw_name, int quiet);
-int  bind (int minor, int block_major, int block_minor);
+static int query(int minor_raw, const char *raw_name, int quiet);
+static int bind(int minor_raw, int block_major, int block_minor);
 
 
 static void usage(int err)
@@ -190,7 +190,7 @@ void open_raw_ctl(void)
 	}
 }
 
-int query(int minor, const char *raw_name, int quiet)
+static int query(int minor_raw, const char *raw_name, int quiet)
 {
 	struct raw_config_request rq;
 	static int has_worked = 0;
@@ -216,10 +216,10 @@ int query(int minor, const char *raw_name, int quiet)
 				 raw_name);
 			exit(2);
 		}
-		minor = minor(statbuf.st_rdev);
+		minor_raw = minor(statbuf.st_rdev);
 	}
 
-	rq.raw_minor = minor;
+	rq.raw_minor = minor_raw;
 	err = ioctl(master_fd, RAW_GETBIND, &rq);
 	if (err < 0) {
 		if (quiet && errno == ENODEV)
@@ -242,12 +242,12 @@ int query(int minor, const char *raw_name, int quiet)
 	return 0;
 }
 
-int bind(int minor, int block_major, int block_minor)
+static int bind(int minor_raw, int block_major, int block_minor)
 {
 	struct raw_config_request rq;
 	int err;
 
-	rq.raw_minor   = minor;
+	rq.raw_minor   = minor_raw;
 	rq.block_major = block_major;
 	rq.block_minor = block_minor;
 	err = ioctl(master_fd, RAW_SETBIND, &rq);
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-31 15:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-29 16:59 [PATCH] raw: fix shadowing of minor function maximilian attems
2011-08-30  9:54 ` Karel Zak
2011-08-31 15:17   ` maximilian attems

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox