hammer2 - complain if the hammer2 kld module isn't loaded
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 10 Feb 2012 02:18:45 +0000 (18:18 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 10 Feb 2012 02:18:45 +0000 (18:18 -0800)
* Complain if the hammer2 kld module isn't loaded instead of exiting
  silently.

sbin/mount_hammer2/mount_hammer2.c

index a57a491..7a2688a 100644 (file)
@@ -59,13 +59,16 @@ main(int argc, char *argv[])
                exit(1);
 
        error = getvfsbyname("hammer2", &vfc);
+       if (error) {
+               fprintf(stderr, "hammer2 vfs not loaded\n");
+               exit(1);
+       }
 
        info.volume = argv[1];
        info.hflags = 0;
        mountpt = argv[2];
 
        error = mount(vfc.vfc_name, mountpt, mount_flags, &info);
-       if (error) {
+       if (error)
                perror("mount: ");
-       }
 }