Diff for /src/usr.sbin/quotaon/quotaon.c between versions 1.4 and 1.5

version 1.4, 2003/11/03 19:31:41 version 1.5, 2004/03/21 22:41:24
Line 68  int readonly(struct fstab *); Line 68  int readonly(struct fstab *);
 static void usage(void);  static void usage(void);
   
 int  int
main(argc, argv)main(int argc, char **argv)
        int argc; 
        char **argv; 
 {  {
        register struct fstab *fs;        struct fstab *fs;
         char ch, *qfnp, *whoami;          char ch, *qfnp, *whoami;
         long argnum, done = 0;          long argnum, done = 0;
         int i, offmode = 0, errs = 0;          int i, offmode = 0, errs = 0;
Line 139  main(argc, argv) Line 137  main(argc, argv)
 }  }
   
 static void  static void
usage()usage(void)
 {  {
   
         fprintf(stderr, "%s\n%s\n%s\n%s\n",          fprintf(stderr, "%s\n%s\n%s\n%s\n",
                 "usage: quotaon [-g] [-u] [-v] -a",                  "usage: quotaon [-g] [-u] [-v] -a",
                 "       quotaon [-g] [-u] [-v] filesystem ...",                  "       quotaon [-g] [-u] [-v] filesystem ...",
Line 151  usage() Line 148  usage()
 }  }
   
 int  int
quotaonoff(fs, offmode, type, qfpathname)quotaonoff(struct fstab *fs, int offmode, int type, char *qfpathname)
        register struct fstab *fs; 
        int offmode, type; 
        char *qfpathname; 
 {  {
   
         if (strcmp(fs->fs_file, "/") && readonly(fs))          if (strcmp(fs->fs_file, "/") && readonly(fs))
                 return (1);                  return (1);
         if (offmode) {          if (offmode) {
Line 183  quotaonoff(fs, offmode, type, qfpathname Line 176  quotaonoff(fs, offmode, type, qfpathname
  * Check to see if target appears in list of size cnt.   * Check to see if target appears in list of size cnt.
  */   */
 int  int
oneof(target, list, cnt)oneof(char *target, char *list[], int cnt)
        register char *target, *list[]; 
        int cnt; 
 {  {
        register int i;        int i;
   
         for (i = 0; i < cnt; i++)          for (i = 0; i < cnt; i++)
                 if (strcmp(target, list[i]) == 0)                  if (strcmp(target, list[i]) == 0)
Line 199  oneof(target, list, cnt) Line 190  oneof(target, list, cnt)
  * Check to see if a particular quota is to be enabled.   * Check to see if a particular quota is to be enabled.
  */   */
 int  int
hasquota(fs, type, qfnamep)hasquota(struct fstab *fs, int type, char **qfnamep)
        register struct fstab *fs; 
        int type; 
        char **qfnamep; 
 {  {
        register char *opt;        char *opt;
         char *cp;          char *cp;
         static char initname, usrname[100], grpname[100];          static char initname, usrname[100], grpname[100];
         static char buf[BUFSIZ];          static char buf[BUFSIZ];
Line 238  hasquota(fs, type, qfnamep) Line 226  hasquota(fs, type, qfnamep)
  * Verify file system is mounted and not readonly.   * Verify file system is mounted and not readonly.
  */   */
 int  int
readonly(fs)readonly(struct fstab *fs)
        register struct fstab *fs; 
 {  {
         struct statfs fsbuf;          struct statfs fsbuf;
   

Removed from v.1.4  
changed lines
  Added in v.1.5