blob: d6f374385f5519439343ba45ecc6410e4cb8ebfc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/* Test case by Horst von Brand <vonbrand@sleipnir.valparaiso.cl>. */
#include <mntent.h>
#include <stdio.h>
#include <string.h>
int
main (int argc, char *argv[])
{
int result = 0;
struct mntent mef;
struct mntent *mnt = &mef;
mef.mnt_fsname = strdupa ("/dev/hda1");
mef.mnt_dir = strdupa ("/");
mef.mnt_type = strdupa ("ext2");
mef.mnt_opts = strdupa ("defaults");
mef.mnt_freq = 1;
mef.mnt_passno = 1;
if (hasmntopt (mnt, "defaults"))
printf ("Found!\n");
else
{
printf ("Didn't find it\n");
result = 1;
}
return result;
}
|