fixed fact that "rdonly" wasn't supported by -fstype, but the man
page said it was. also fixed multiple fstype checks on the same partition
This commit is contained in:
parent
0be333bc99
commit
609f072018
@ -67,6 +67,7 @@ typedef struct _plandata {
|
||||
} ex;
|
||||
char *_a_data[2]; /* array of char pointers */
|
||||
char *_c_data; /* char pointer */
|
||||
int _m_flags; /* mount flage for fstype */
|
||||
} p_un;
|
||||
#define a_data p_un._a_data
|
||||
#define c_data p_un._c_data
|
||||
@ -81,6 +82,7 @@ typedef struct _plandata {
|
||||
#define e_argv p_un.ex._e_argv
|
||||
#define e_orig p_un.ex._e_orig
|
||||
#define e_len p_un.ex._e_len
|
||||
#define m_flags p_un._m_flags
|
||||
} PLAN;
|
||||
|
||||
#include "extern.h"
|
||||
|
@ -320,8 +320,7 @@ f_fstype(plan, entry)
|
||||
{
|
||||
static dev_t curdev; /* need a guaranteed illegal dev value */
|
||||
static int first = 1;
|
||||
struct statfs sb;
|
||||
static short val;
|
||||
static struct statfs sb;
|
||||
char *p, save[2];
|
||||
|
||||
/* only check when we cross mount point */
|
||||
@ -355,10 +354,9 @@ f_fstype(plan, entry)
|
||||
}
|
||||
|
||||
first = 0;
|
||||
val = plan->flags == MOUNT_NONE ? sb.f_flags : sb.f_type;
|
||||
}
|
||||
return(plan->flags == MOUNT_NONE ?
|
||||
val & MNT_LOCAL : val == plan->flags);
|
||||
sb.f_flags & plan->m_flags : sb.f_type == plan->flags);
|
||||
}
|
||||
|
||||
PLAN *
|
||||
@ -380,6 +378,7 @@ c_fstype(arg)
|
||||
case 'l':
|
||||
if (!strcmp(arg, "local")) {
|
||||
new->flags = MOUNT_NONE;
|
||||
new->m_flags = MNT_LOCAL;
|
||||
return(new);
|
||||
}
|
||||
break;
|
||||
@ -399,6 +398,13 @@ c_fstype(arg)
|
||||
return(new);
|
||||
}
|
||||
break;
|
||||
case 'r':
|
||||
if (!strcmp(arg, "rdonly")) {
|
||||
new->flags = MOUNT_NONE;
|
||||
new->m_flags = MNT_RDONLY;
|
||||
return(new);
|
||||
}
|
||||
break;
|
||||
case 'u':
|
||||
if (!strcmp(arg, "ufs")) {
|
||||
new->flags = MOUNT_UFS;
|
||||
|
Loading…
Reference in New Issue
Block a user