*/
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
*/
#include <libzfs.h>
return (-1);
}
+#ifdef HAVE_SETMNTENT
+ if ((fp = setmntent(MNTTAB, "r")) == NULL) {
+#else
if ((fp = fopen(MNTTAB, "r")) == NULL) {
+#endif
(void) fprintf(stderr, "cannot open /etc/mtab\n");
return (-1);
}
&record->zi_guid) == 0);
}
+ /*
+ * Device faults can take on three different forms:
+ * 1). delayed or hanging I/O
+ * 2). zfs label faults
+ * 3). generic disk faults
+ */
+ if (record->zi_timer != 0) {
+ record->zi_cmd = ZINJECT_DELAY_IO;
+ } else if (label_type != TYPE_INVAL) {
+ record->zi_cmd = ZINJECT_LABEL_FAULT;
+ } else {
+ record->zi_cmd = ZINJECT_DEVICE_FAULT;
+ }
+
switch (label_type) {
default:
break;