4.104.115
Last change
on this file since e4a3d93 was
031deada,
checked in by Ralf Corsepius <ralf.corsepius@…>, on 01/02/09 at 13:04:13
|
Add attribute((unused)) to unused function args.
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Line | |
---|
1 | /* |
---|
2 | * Shell Command Implmentation |
---|
3 | * |
---|
4 | * Author: Fernando RUIZ CASAS |
---|
5 | * Work: fernando.ruiz@ctv.es |
---|
6 | * Home: correo@fernando-ruiz.com |
---|
7 | * |
---|
8 | * The license and distribution terms for this file may be |
---|
9 | * found in the file LICENSE in this distribution or at |
---|
10 | * http://www.rtems.com/license/LICENSE. |
---|
11 | * |
---|
12 | * $Id$ |
---|
13 | */ |
---|
14 | |
---|
15 | #ifdef HAVE_CONFIG_H |
---|
16 | #include "config.h" |
---|
17 | #endif |
---|
18 | |
---|
19 | #include <stdio.h> |
---|
20 | #include <unistd.h> |
---|
21 | #include <string.h> |
---|
22 | #include <errno.h> |
---|
23 | |
---|
24 | #include <rtems.h> |
---|
25 | #include <rtems/shell.h> |
---|
26 | #include "internal.h" |
---|
27 | |
---|
28 | #include <librtemsNfs.h> |
---|
29 | |
---|
30 | static int |
---|
31 | rtems_shell_nfs_mounter ( |
---|
32 | const char* device, |
---|
33 | const char* mntpoint, |
---|
34 | rtems_shell_filesystems_t* fs __attribute__((unused)), |
---|
35 | rtems_filesystem_options_t options __attribute__((unused))) |
---|
36 | { |
---|
37 | char* uidhost; |
---|
38 | char* path; |
---|
39 | int ret; |
---|
40 | |
---|
41 | if (strchr (device, ':') == NULL) { |
---|
42 | fprintf (stderr, "error: nfs mount device is [uid.gid@]host:path\n"); |
---|
43 | return -1; |
---|
44 | } |
---|
45 | |
---|
46 | if (rpcUdpInit () < 0) { |
---|
47 | fprintf (stderr, "error: initialising RPC\n"); |
---|
48 | return -1; |
---|
49 | } |
---|
50 | |
---|
51 | nfsInit (0, 0); |
---|
52 | |
---|
53 | uidhost = strdup (device); |
---|
54 | path = strchr (uidhost, ':'); |
---|
55 | *path = '\0'; |
---|
56 | path++; |
---|
57 | |
---|
58 | ret = nfsMount(uidhost, path, (char*) mntpoint); |
---|
59 | |
---|
60 | free (uidhost); |
---|
61 | |
---|
62 | return ret; |
---|
63 | } |
---|
64 | |
---|
65 | rtems_shell_filesystems_t rtems_shell_Mount_NFS = { |
---|
66 | name: "nfs", |
---|
67 | driver_needed: 1, |
---|
68 | fs_ops: NULL, |
---|
69 | mounter: rtems_shell_nfs_mounter |
---|
70 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.