summaryrefslogtreecommitdiff
path: root/util-linux/nfsmount.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-03-10 19:22:06 +0000
committerRob Landley <rob@landley.net>2006-03-10 19:22:06 +0000
commitbc68cd14ccaebc17e7e03a08e51fddfb91007624 (patch)
treebeb32cedafc6232bf8a49fe90f0769d471ea6791 /util-linux/nfsmount.c
parentdae6aa28598cb2353291f18ca52e768c3259165a (diff)
downloadbusybox-w32-bc68cd14ccaebc17e7e03a08e51fddfb91007624.tar.gz
busybox-w32-bc68cd14ccaebc17e7e03a08e51fddfb91007624.tar.bz2
busybox-w32-bc68cd14ccaebc17e7e03a08e51fddfb91007624.zip
Patch from Denis Vlasenko turning static const int (which gets emitted into
the busybox binary) into enums (which don't).
Diffstat (limited to 'util-linux/nfsmount.c')
-rw-r--r--util-linux/nfsmount.c64
1 files changed, 35 insertions, 29 deletions
diff --git a/util-linux/nfsmount.c b/util-linux/nfsmount.c
index a51fe817e..1acec606f 100644
--- a/util-linux/nfsmount.c
+++ b/util-linux/nfsmount.c
@@ -105,13 +105,14 @@ enum nfs_stat {
105#define NFS_PROGRAM 100003 105#define NFS_PROGRAM 100003
106 106
107 107
108 108enum {
109#ifndef NFS_FHSIZE 109#ifndef NFS_FHSIZE
110static const int NFS_FHSIZE = 32; 110 NFS_FHSIZE = 32,
111#endif 111#endif
112#ifndef NFS_PORT 112#ifndef NFS_PORT
113static const int NFS_PORT = 2049; 113 NFS_PORT = 2049
114#endif 114#endif
115};
115 116
116/* Disable the nls stuff */ 117/* Disable the nls stuff */
117# undef bindtextdomain 118# undef bindtextdomain
@@ -119,19 +120,21 @@ static const int NFS_PORT = 2049;
119# undef textdomain 120# undef textdomain
120# define textdomain(Domain) /* empty */ 121# define textdomain(Domain) /* empty */
121 122
122static const int MS_MGC_VAL = 0xc0ed0000; /* Magic number indicatng "new" flags */ 123enum {
123static const int MS_RDONLY = 1; /* Mount read-only */ 124 MS_MGC_VAL = 0xc0ed0000, /* Magic number indicatng "new" flags */
124static const int MS_NOSUID = 2; /* Ignore suid and sgid bits */ 125 MS_RDONLY = 1, /* Mount read-only */
125static const int MS_NODEV = 4; /* Disallow access to device special files */ 126 MS_NOSUID = 2, /* Ignore suid and sgid bits */
126static const int MS_NOEXEC = 8; /* Disallow program execution */ 127 MS_NODEV = 4, /* Disallow access to device special files */
127static const int MS_SYNCHRONOUS = 16; /* Writes are synced at once */ 128 MS_NOEXEC = 8, /* Disallow program execution */
128static const int MS_REMOUNT = 32; /* Alter flags of a mounted FS */ 129 MS_SYNCHRONOUS = 16, /* Writes are synced at once */
129static const int MS_MANDLOCK = 64; /* Allow mandatory locks on an FS */ 130 MS_REMOUNT = 32, /* Alter flags of a mounted FS */
130static const int S_QUOTA = 128; /* Quota initialized for file/directory/symlink */ 131 MS_MANDLOCK = 64, /* Allow mandatory locks on an FS */
131static const int S_APPEND = 256; /* Append-only file */ 132 S_QUOTA = 128, /* Quota initialized for file/directory/symlink */
132static const int S_IMMUTABLE = 512; /* Immutable file */ 133 S_APPEND = 256, /* Append-only file */
133static const int MS_NOATIME = 1024; /* Do not update access times. */ 134 S_IMMUTABLE = 512, /* Immutable file */
134static const int MS_NODIRATIME = 2048; /* Do not update directory access times */ 135 MS_NOATIME = 1024, /* Do not update access times. */
136 MS_NODIRATIME = 2048 /* Do not update directory access times */
137};
135 138
136 139
137/* 140/*
@@ -177,17 +180,18 @@ struct nfs_mount_data {
177}; 180};
178 181
179/* bits in the flags field */ 182/* bits in the flags field */
180 183enum {
181static const int NFS_MOUNT_SOFT = 0x0001; /* 1 */ 184 NFS_MOUNT_SOFT = 0x0001, /* 1 */
182static const int NFS_MOUNT_INTR = 0x0002; /* 1 */ 185 NFS_MOUNT_INTR = 0x0002, /* 1 */
183static const int NFS_MOUNT_SECURE = 0x0004; /* 1 */ 186 NFS_MOUNT_SECURE = 0x0004, /* 1 */
184static const int NFS_MOUNT_POSIX = 0x0008; /* 1 */ 187 NFS_MOUNT_POSIX = 0x0008, /* 1 */
185static const int NFS_MOUNT_NOCTO = 0x0010; /* 1 */ 188 NFS_MOUNT_NOCTO = 0x0010, /* 1 */
186static const int NFS_MOUNT_NOAC = 0x0020; /* 1 */ 189 NFS_MOUNT_NOAC = 0x0020, /* 1 */
187static const int NFS_MOUNT_TCP = 0x0040; /* 2 */ 190 NFS_MOUNT_TCP = 0x0040, /* 2 */
188static const int NFS_MOUNT_VER3 = 0x0080; /* 3 */ 191 NFS_MOUNT_VER3 = 0x0080, /* 3 */
189static const int NFS_MOUNT_KERBEROS = 0x0100; /* 3 */ 192 NFS_MOUNT_KERBEROS = 0x0100, /* 3 */
190static const int NFS_MOUNT_NONLM = 0x0200; /* 3 */ 193 NFS_MOUNT_NONLM = 0x0200 /* 3 */
194};
191 195
192 196
193#define UTIL_LINUX_VERSION "2.10m" 197#define UTIL_LINUX_VERSION "2.10m"
@@ -213,8 +217,10 @@ static char *nfs_strerror(int status);
213#define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r)) 217#define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r))
214#define MAX_NFSPROT ((nfs_mount_version >= 4) ? 3 : 2) 218#define MAX_NFSPROT ((nfs_mount_version >= 4) ? 3 : 2)
215 219
216static const int EX_FAIL = 32; /* mount failure */ 220enum {
217static const int EX_BG = 256; /* retry in background (internal only) */ 221 EX_FAIL = 32, /* mount failure */
222 EX_BG = 256 /* retry in background (internal only) */
223};
218 224
219 225
220/* 226/*