getmntopts.c (28671) | getmntopts.c (37425) |
---|---|
1/*- 2 * Copyright (c) 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)getmntopts.c 8.3 (Berkeley) 3/29/95"; 37#else 38static const char rcsid[] = | 1/*- 2 * Copyright (c) 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)getmntopts.c 8.3 (Berkeley) 3/29/95"; 37#else 38static const char rcsid[] = |
39 "$Id$"; | 39 "$Id: getmntopts.c,v 1.6 1997/08/24 21:02:47 steve Exp $"; |
40#endif 41#endif /* not lint */ 42 43#include <sys/param.h> | 40#endif 41#endif /* not lint */ 42 43#include <sys/param.h> |
44#include <sys/mount.h> | |
45 46#include <err.h> | 44 45#include <err.h> |
47#include <errno.h> 48#include <fstab.h> | |
49#include <stdlib.h> 50#include <string.h> 51 | 46#include <stdlib.h> 47#include <string.h> 48 |
52#include "extern.h" | |
53#include "mntopts.h" 54 55int getmnt_silent = 0; 56 57void 58getmntopts(options, m0, flagp, altflagp) 59 const char *options; 60 const struct mntopt *m0; --- 30 unchanged lines hidden (view full) --- 91 len = strlen(m->m_option); 92 if (strncasecmp(opt, m->m_option, len) == 0) 93 if ( m->m_option[len] == '\0' 94 || m->m_option[len] == '=' 95 ) 96 break; 97 } 98 | 49#include "mntopts.h" 50 51int getmnt_silent = 0; 52 53void 54getmntopts(options, m0, flagp, altflagp) 55 const char *options; 56 const struct mntopt *m0; --- 30 unchanged lines hidden (view full) --- 87 len = strlen(m->m_option); 88 if (strncasecmp(opt, m->m_option, len) == 0) 89 if ( m->m_option[len] == '\0' 90 || m->m_option[len] == '=' 91 ) 92 break; 93 } 94 |
99 /* Save flag, or fail if option is not recognised. */ | 95 /* Save flag, or fail if option is not recognized. */ |
100 if (m->m_option) { 101 thisflagp = m->m_altloc ? altflagp : flagp; 102 if (negative == m->m_inverse) 103 *thisflagp |= m->m_flag; 104 else 105 *thisflagp &= ~m->m_flag; 106 } else if (!getmnt_silent) { 107 errx(1, "-o %s: option not supported", opt); 108 } 109 } 110 111 free(optbuf); 112} | 96 if (m->m_option) { 97 thisflagp = m->m_altloc ? altflagp : flagp; 98 if (negative == m->m_inverse) 99 *thisflagp |= m->m_flag; 100 else 101 *thisflagp &= ~m->m_flag; 102 } else if (!getmnt_silent) { 103 errx(1, "-o %s: option not supported", opt); 104 } 105 } 106 107 free(optbuf); 108} |