]> git.pld-linux.org Git - packages/util-linux.git/blame - util-linux-mount-nonfs.patch
- no const
[packages/util-linux.git] / util-linux-mount-nonfs.patch
CommitLineData
5545a732
JR
1--- util-linux-2.13-pre6/mount/Makefile.am.nonfs 2006-09-20 12:45:50.000000000 +0200
2+++ util-linux-2.13-pre6/mount/Makefile.am 2006-09-20 12:46:51.000000000 +0200
3@@ -1,15 +1,12 @@
4 include $(top_srcdir)/config/include-Makefile.am
5
6-AM_CPPFLAGS += -DHAVE_NFS
7-
8 bin_PROGRAMS = mount umount
9 sbin_PROGRAMS = losetup swapon
10-man_MANS = fstab.5 nfs.5 mount.8 swapoff.8 swapon.8 umount.8 losetup.8
11+man_MANS = fstab.5 mount.8 swapoff.8 swapon.8 umount.8 losetup.8
12
13 mount_SOURCES = mount.c fstab.c sundries.c xmalloc.c realpath.c mntent.c \
14 get_label_uuid.c mount_by_label.c mount_blkid.c mount_guess_fstype.c \
15 getusername.c cryptsetup.c \
16- nfsmount.c nfsmount_xdr.c nfsmount_clnt.c \
17 lomount.c
18
19 mount_LDADD = $(top_srcdir)/lib/libenv.a $(top_srcdir)/lib/libsetproctitle.a
20--- util-linux-2.13-pre6/mount/sundries.c.nonfs 2006-09-20 12:53:09.000000000 +0200
21+++ util-linux-2.13-pre6/mount/sundries.c 2006-09-20 12:53:13.000000000 +0200
22@@ -15,7 +15,6 @@
23 #include "fstab.h"
24 #include "sundries.h"
25 #include "realpath.h"
26-#include "nfsmount.h"
27 #include "nls.h"
28
29 char *
30--- util-linux-2.13-pre6/mount/umount.c.nonfs 2006-09-20 12:51:11.000000000 +0200
31+++ util-linux-2.13-pre6/mount/umount.c 2006-09-20 12:52:26.000000000 +0200
32@@ -20,15 +20,6 @@
33 #include "env.h"
34 #include "nls.h"
35
36-#include <sys/socket.h>
37-#include <sys/time.h>
38-#include <netdb.h>
39-#include <rpc/rpc.h>
40-#include <rpc/pmap_clnt.h>
41-#include <rpc/pmap_prot.h>
42-#include "nfsmount.h"
43-#include <arpa/inet.h>
44-
45 #if defined(MNT_FORCE) && !defined(__sparc__) && !defined(__arm__)
46 /* Interesting ... it seems libc knows about MNT_FORCE and presumably
47 about umount2 as well -- need not do anything */
48@@ -144,98 +135,6 @@
49 return 0;
50 }
51
52-static int xdr_dir(XDR *xdrsp, char *dirp)
53-{
54- return (xdr_string(xdrsp, &dirp, MNTPATHLEN));
55-}
56-
57-static int
58-nfs_umount_rpc_call(const char *spec, const char *opts)
59-{
60- register CLIENT *clp;
61- struct sockaddr_in saddr;
62- struct timeval pertry, try;
63- enum clnt_stat clnt_stat;
64- int port = 0;
65- int so = RPC_ANYSOCK;
66- struct hostent *hostp;
67- char *hostname;
68- char *dirname;
69- char *p;
70-
71- if (spec == NULL || (p = strchr(spec,':')) == NULL)
72- return 0;
73- hostname = xstrndup(spec, p-spec);
74- dirname = xstrdup(p+1);
75-#ifdef DEBUG
76- printf(_("host: %s, directory: %s\n"), hostname, dirname);
77-#endif
78-
79- if (opts && (p = strstr(opts, "addr="))) {
80- char *q;
81-
82- free(hostname);
83- p += 5;
84- q = p;
85- while (*q && *q != ',') q++;
86- hostname = xstrndup(p,q-p);
87- }
88-
89- if (opts && (p = strstr(opts, "mountport=")) && isdigit(*(p+10)))
90- port = atoi(p+10);
91-
92- if (hostname[0] >= '0' && hostname[0] <= '9')
93- saddr.sin_addr.s_addr = inet_addr(hostname);
94- else {
95- if ((hostp = gethostbyname(hostname)) == NULL) {
96- fprintf(stderr, _("umount: can't get address for %s\n"),
97- hostname);
98- return 1;
99- }
100- if (hostp->h_length > sizeof(struct in_addr)) {
101- fprintf(stderr, _("umount: got bad hostp->h_length\n"));
102- hostp->h_length = sizeof(struct in_addr);
103- }
104- memcpy(&saddr.sin_addr, hostp->h_addr, hostp->h_length);
105- }
106-
107- saddr.sin_family = AF_INET;
108- saddr.sin_port = htons(port);
109- pertry.tv_sec = 3;
110- pertry.tv_usec = 0;
111- if (opts && (p = strstr(opts, "tcp"))) {
112- /* possibly: make sure option is not "notcp"
113- possibly: try udp if tcp fails */
114- if ((clp = clnttcp_create(&saddr, MOUNTPROG, MOUNTVERS,
115- &so, 0, 0)) == NULL) {
116- clnt_pcreateerror("Cannot MOUNTPROG RPC (tcp)");
117- return 1;
118- }
119- } else {
120- if ((clp = clntudp_create(&saddr, MOUNTPROG, MOUNTVERS,
121- pertry, &so)) == NULL) {
122- clnt_pcreateerror("Cannot MOUNTPROG RPC");
123- return 1;
124- }
125- }
126- clp->cl_auth = authunix_create_default();
127- try.tv_sec = 20;
128- try.tv_usec = 0;
129- clnt_stat = clnt_call(clp, MOUNTPROC_UMNT,
130- (xdrproc_t) xdr_dir, dirname,
131- (xdrproc_t) xdr_void, (caddr_t) 0,
132- try);
133-
134- if (clnt_stat != RPC_SUCCESS) {
135- clnt_perror(clp, "Bad UMNT RPC");
136- return 1;
137- }
138- auth_destroy(clp->cl_auth);
139- clnt_destroy(clp);
140-
141- return 0;
142-}
143-
144 /* complain about a failed umount */
145 static void complain(int err, const char *dev) {
146 switch (err) {
147@@ -289,11 +188,6 @@
148 if (check_special_umountprog(spec, node, type, &status))
149 return status;
150
151- /* Ignore any RPC errors, so that you can umount the filesystem
152- if the server is down. */
153- if (strcasecmp(type, "nfs") == 0)
154- nfs_umount_rpc_call(spec, opts);
155-
156 umnt_err = umnt_err2 = 0;
157 if (lazy) {
158 res = umount2 (node, MNT_DETACH);
159--- util-linux-2.13-pre6/mount/mount.c.nonfs 2006-09-20 12:48:48.000000000 +0200
160+++ util-linux-2.13-pre6/mount/mount.c 2006-09-20 12:48:33.000000000 +0200
161@@ -966,19 +966,6 @@
162 goto out;
163 }
164
165- /*
166- * Also nfs requires a separate program, but it is built in.
167- */
168- if (!fake && types && streq (types, "nfs")) {
169-retry_nfs:
170- mnt_err = nfsmount (spec, node, &flags, &extra_opts, &mount_opts,
171- &nfs_mount_version, bg);
172- if (mnt_err) {
173- res = mnt_err;
174- goto out;
175- }
176- }
177-
178 block_signals (SIG_BLOCK);
179
180 if (!fake) {
181@@ -1018,15 +1005,6 @@
182
183 block_signals (SIG_UNBLOCK);
184
185- if (mnt_err && types && streq (types, "nfs")) {
186- if (nfs_mount_version == 4 && mnt_err != EBUSY && mnt_err != ENOENT) {
187- if (verbose)
188- printf(_("mount: failed with nfs mount version 4, trying 3..\n"));
189- nfs_mount_version = 3;
190- goto retry_nfs;
191- }
192- }
193-
194 /* Mount failed, complain, but don't die. */
195
196 if (types == 0) {
This page took 0.457071 seconds and 4 git commands to generate.