Test for mntent functions.
authordrepper <drepper>
Fri, 8 May 1998 23:52:27 +0000 (23:52 +0000)
committerdrepper <drepper>
Fri, 8 May 1998 23:52:27 +0000 (23:52 +0000)
misc/tst-mntent.c [new file with mode: 0644]

diff --git a/misc/tst-mntent.c b/misc/tst-mntent.c
new file mode 100644 (file)
index 0000000..cd67c98
--- /dev/null
@@ -0,0 +1,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; 
+}