Utako Kusaka wrote:
This patch fixes the issue that
xfs_db ring [index] command don't move to specified index.
Signed-off-by: Utako Kusaka <utako@xxxxxxxxxxxxxx>
---
--- xfsprogs-2.8.11-orgn/db/io.c 2006-06-26 14:01:14.000000000 +0900
+++ xfsprogs-2.8.11/db/io.c 2006-09-26 16:59:40.000000000 +0900
@@ -352,7 +352,7 @@ ring_f(
return 0;
}
- index = (int)strtoul(argv[0], NULL, 0);
+ index = (int)strtoul(argv[1], NULL, 0);
if (index < 0 || index >= RING_ENTRIES)
dbprintf("invalid entry: %d\n", index);
Hi there,
Thanks for that.
I'll check it in shortly.
Aside:
I think I can see how this happened.
It must have been due to porting from IRIX to Linux.
On IRIX the db commands removed the command name,
and just passed in the arguments to the specific command
function; they did:
ON IRIX:
------------
command(
int argc,
char **argv)
{
char *cmd;
const cmdinfo_t *ct;
cmd = argv[0];
ct = find_command(cmd);
if (ct == NULL) {
dbprintf("command %s not found\n", cmd);
return 0;
}
--> argc--;
--> argv++;
if (argc < ct->argmin || (ct->argmax != -1 && argc > ct->argmax)) {
...
return ct->cfunc(argc, argv);
-------------
But on Linux we pass through the command name as well:
--------------
int
command(
int argc,
char **argv)
{
char *cmd;
const cmdinfo_t *ct;
cmd = argv[0];
ct = find_command(cmd);
if (ct == NULL) {
dbprintf("command %s not found\n", cmd);
return 0;
}
if (argc-1 < ct->argmin || (ct->argmax != -1 && argc-1 > ct->argmax)) {
...
return ct->cfunc(argc, argv);
--------------
So I hope no more of these mistakes have happened because I'd
imagine many of the commands would have had to change.
I noticed that someone fixed up part of ring_f command but not the part
that you found/fixed.
Cheers,
Tim.
|