aboutsummaryrefslogtreecommitdiff
path: root/misc/tst-mntent.c
blob: cd67c98fe62a014ad1dc8fc636283b205107ce4e (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
/* Test case by Horst von Brand <vonbrand@sleipnir.valparaiso.cl>.  */
#include <stdio.h> 
#include <mntent.h> 
 
int
main (int argc, char *argv[]) 
{ 
  int result = 0;
  struct mntent mef =
  { 
     "/dev/hda1", "/", "ext2", "defaults", 1, 1 
  }; 
  struct mntent *mnt = &mef; 
 
  if (hasmntopt (mnt, "defaults"))  
    printf("Found!\n"); 
  else 
    {
      printf("Didn't find it\n"); 
      result = 1;
    }
   
   return result; 
}