summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/mount.c2
-rw-r--r--utils/ps.c40
-rw-r--r--utils/rpctrace.c12
3 files changed, 30 insertions, 24 deletions
diff --git a/utils/mount.c b/utils/mount.c
index 8e593aac..e9f64d85 100644
--- a/utils/mount.c
+++ b/utils/mount.c
@@ -248,7 +248,7 @@ do_mount (struct fs *fs, int remount)
{
ARGZ (add (&fsopts, &fsopts_len, o));
}
- else
+ else if (strcmp (o, "defaults") != 0)
{
/* Prepend `--' to the option to make a long option switch,
e.g. `--ro' or `--rsize=1024'. */
diff --git a/utils/ps.c b/utils/ps.c
index 6f209655..992b467d 100644
--- a/utils/ps.c
+++ b/utils/ps.c
@@ -324,6 +324,28 @@ main(int argc, char *argv[])
state->child_inputs[0] = &pids_argp_params;
break;
+ case ARGP_KEY_SUCCESS:
+ /* Select an explicit format string if FMT_STRING is a format
+ name. This is done here because parse_enum needs STATE. */
+ {
+ const char *fmt_name (unsigned n)
+ {
+ return
+ n >= (sizeof output_fmts / sizeof *output_fmts)
+ ? 0
+ : output_fmts[n].name;
+ }
+ int fmt_index = parse_enum (fmt_string, fmt_name,
+ "format type", 1, state);
+ if (fmt_index >= 0)
+ {
+ fmt_string = output_fmts[fmt_index].fmt;
+ if (sort_key_name == NULL)
+ sort_key_name = output_fmts[fmt_index].sort_key;
+ }
+ }
+ break;
+
default:
return ARGP_ERR_UNKNOWN;
}
@@ -343,24 +365,6 @@ main(int argc, char *argv[])
/* Parse our command line. This shouldn't ever return an error. */
argp_parse (&argp, argc, argv, 0, 0, 0);
- /* Select an explicit format string if FMT_STRING is a format name. */
- {
- const char *fmt_name (unsigned n)
- {
- return
- n >= (sizeof output_fmts / sizeof *output_fmts)
- ? 0
- : output_fmts[n].name;
- }
- int fmt_index = parse_enum (fmt_string, fmt_name, "format type", 1, 0);
- if (fmt_index >= 0)
- {
- fmt_string = output_fmts[fmt_index].fmt;
- if (sort_key_name == NULL)
- sort_key_name = output_fmts[fmt_index].sort_key;
- }
- }
-
err = proc_stat_list_create(context, &procset);
if (err)
error(1, err, "proc_stat_list_create");
diff --git a/utils/rpctrace.c b/utils/rpctrace.c
index b7379a76..e75bd0df 100644
--- a/utils/rpctrace.c
+++ b/utils/rpctrace.c
@@ -1,6 +1,6 @@
/* Trace RPCs sent to selected ports
- Copyright (C) 1998, 1999, 2001, 2002, 2003, 2005, 2006
+ Copyright (C) 1998, 1999, 2001, 2002, 2003, 2005, 2006, 2009
Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -632,10 +632,12 @@ print_contents (mach_msg_header_t *inp,
type->msgt_name = name;
}
else if (nelt > 0 && newtypes[0] != name)
- if (type->msgt_longform)
- lt->msgtl_name = newtypes[0];
- else
- type->msgt_name = newtypes[0];
+ {
+ if (type->msgt_longform)
+ lt->msgtl_name = newtypes[0];
+ else
+ type->msgt_name = newtypes[0];
+ }
}
else
print_data (name, data, nelt, eltsize);