summaryrefslogtreecommitdiff
path: root/resize
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>1998-04-08 06:18:37 +0000
committerTheodore Ts'o <tytso@mit.edu>1998-04-08 06:18:37 +0000
commit2e561e024947b75864579bf4fea10c848ca0169e (patch)
tree23bc2eda70e4e87ed80e37f823999b0c14d05395 /resize
parentffe1991f4760dc03da26816d9a459a0b62b597a0 (diff)
downloade2fsprogs-2e561e024947b75864579bf4fea10c848ca0169e.tar.gz
main.c, .del-version.h~524d144b:
Add expire time checking to the resize2fs driver program. Change the version number to be version 1.02.
Diffstat (limited to 'resize')
-rw-r--r--resize/main.c41
-rw-r--r--resize/version.h4
2 files changed, 40 insertions, 5 deletions
diff --git a/resize/main.c b/resize/main.c
index 4f7cc6f2..c11222f7 100644
--- a/resize/main.c
+++ b/resize/main.c
@@ -14,16 +14,25 @@
#include <fcntl.h>
#include <sys/ioctl.h>
-
#include "resize2fs.h"
#include "./version.h"
+#define EXPIRE_TIME 905835600
+
+#ifdef EXPIRE_TIME
+static void check_expire_time(const char *progname);
+#endif
+
char *program_name, *device_name;
static volatile void usage (char *prog)
{
- fprintf (stderr, "usage: %s [-d debug_flags] [-f] [-F] [-p] device new-size\n", prog);
+ fprintf (stderr, "usage: %s [-d debug_flags] [-f] [-F] [-p] device new-size\n\n", prog);
+
+#ifdef EXPIRE_TIME
+ check_expire_time(program_name);
+#endif
exit (1);
}
@@ -99,6 +108,27 @@ static void check_mount(char *device)
exit(1);
}
+#ifdef EXPIRE_TIME
+static void check_expire_time(const char *progname)
+{
+ time_t timenow;
+
+ timenow = time(0);
+
+ if (timenow > EXPIRE_TIME) {
+ fprintf(stderr, "This beta-test version of %s is expired.\n"
+ "Please contact PowerQuest to get an updated version "
+ "of this program.\n\n", progname);
+ exit(1);
+ } else {
+ fprintf(stderr, "Please note this is a beta-test version of "
+ "%s which will\nexpire in %d days.\n\n", progname,
+ (EXPIRE_TIME - timenow) / (60*60*24));
+ }
+}
+#endif
+
+
void main (int argc, char ** argv)
{
@@ -122,7 +152,7 @@ void main (int argc, char ** argv)
fprintf(stderr, "Copyright 1998 by Theodore Ts'o and PowerQuest, Inc. All Rights Reserved.\n\n");
if (argc && *argv)
program_name = *argv;
-
+
while ((c = getopt (argc, argv, "d:fFhp")) != EOF) {
switch (c) {
case 'h':
@@ -146,6 +176,11 @@ void main (int argc, char ** argv)
}
if (optind == argc)
usage(program_name);
+
+#ifdef EXPIRE_TIME
+ check_expire_time(program_name);
+#endif
+
device_name = argv[optind++];
if (optind < argc) {
new_size = strtoul(argv[optind++], &tmp, 0);
diff --git a/resize/version.h b/resize/version.h
index cd5bdb4f..4ee9343b 100644
--- a/resize/version.h
+++ b/resize/version.h
@@ -6,6 +6,6 @@
* be redistributed under the GNU Public License.
*/
-#define E2FSPROGS_VERSION "1.01"
-#define E2FSPROGS_DATE "20-Mar-98"
+#define E2FSPROGS_VERSION "1.02"
+#define E2FSPROGS_DATE "08-Apr-98"