diff options
author | Miles Bader <miles@gnu.org> | 1997-02-23 06:05:06 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1997-02-23 06:05:06 +0000 |
commit | 672237ed11bb48eb5f9fed1e80f48d8657a2abf2 (patch) | |
tree | c94381ab468b3b9d6c97207c7b757eb6200e8ddc /trans/firmlink.c | |
parent | 4290a337e6dfa1323434743ef2ff1811f4ff9a97 (diff) |
(options, parse_opt):
Remove -i.
(getroot):
If firmlink returns ENOENT, act like an unresolvable link.
Don't support visible mode.
(argp):
Use OPTIONS.
Diffstat (limited to 'trans/firmlink.c')
-rw-r--r-- | trans/firmlink.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/trans/firmlink.c b/trans/firmlink.c index effae3d4..ca159ea5 100644 --- a/trans/firmlink.c +++ b/trans/firmlink.c @@ -34,7 +34,6 @@ const char *argp_program_version = STANDARD_HURD_VERSION (firmlink); static const struct argp_option options[] = { - { "invisible", 'i', 0, 0, "Don't resemble a symlink" }, { 0 } }; @@ -50,14 +49,11 @@ static const char doc[] = "A translator for firmlinks" /* Link parameters. */ static char *target = 0; /* What we translate too. */ -static int invisible = 0; /* Return a link node to O_NOLINK opens? */ static error_t parse_opt (int key, char *arg, struct argp_state *state) { - if (key == 'i') - invisible = 1; - else if (key == ARGP_KEY_ARG && state->arg_num == 0) + if (key == ARGP_KEY_ARG && state->arg_num == 0) target = arg; else if (key == ARGP_KEY_ARG || key == ARGP_KEY_NO_ARGS) argp_usage (state); @@ -66,7 +62,7 @@ parse_opt (int key, char *arg, struct argp_state *state) return 0; } -static struct argp argp = { 0, parse_opt, args_doc, doc }; +static struct argp argp = { options, parse_opt, args_doc, doc }; void main (int argc, char **argv) @@ -137,14 +133,13 @@ getroot (struct trivfs_control *cntl, retry_type *do_retry, char *retry_name, mach_port_t *node, mach_msg_type_name_t *node_type) { - error_t err; + error_t err = firmlink (dotdot, target, flags, node); - if ((flags & O_NOLINK) && !invisible) - /* Cons up our own node. */ + if (err == ENOENT) + /* No target? Act like a link. */ return EAGAIN; - err = firmlink (dotdot, target, flags, node); - if (!err) + if (! err) { *node_type = MACH_MSG_TYPE_MOVE_SEND; *do_retry = FS_RETRY_REAUTH; |