* University of Maryland at College Park
*/
/*
- * $Id: tapetype.c,v 1.3.2.3.4.3.2.9.2.3 2005/10/02 13:48:42 martinea Exp $
+ * $Id: tapetype.c,v 1.24 2006/03/10 11:56:06 martinea Exp $
*
* tests a tape in a given tape unit and prints a tapetype entry for
* it. */
static int blocksize;
static char *randombytes = (char *) NULL;
+static char *prandombytes = (char *) NULL;
#if USE_RAND
/* If the C library does not define random(), try to use rand() by
} else {
randombytes = p; /* alloc already on boundary */
}
+ prandombytes = p;
}
}
sProgName++;
}
+ /* Don't die when child closes pipe */
+ signal(SIGPIPE, SIG_IGN);
+
estsize = 1024 * 1024; /* assume 1 GByte for now */
tapedev = getenv("TAPE");
typename = "unknown-tapetype";
if (tapefd_rewind(fd) == -1) {
fprintf(stderr, "%s: could not rewind %s: %s\n",
sProgName, tapedev, strerror(errno));
+ free(randombytes);
return 1;
}
if (tapefd_close(fd) == -1) {
fprintf(stderr, "%s: could not close %s: %s\n",
sProgName, tapedev, strerror(errno));
+ free(randombytes);
return 1;
}
+ free(randombytes);
return 0;
}