orphan the package with this uploader, but mark myself as an uploader for now
[debian/amanda] / client-src / selfcheck.c
index e044a6cd50fbc6febd1aad01a2f253d2bab5ea48..dfffe2e3c8c214fe3b9b337d97c7ae88dd089f29 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
  * Copyright (c) 1991-1998 University of Maryland at College Park
+ * Copyright (c) 2007-2012 Zmanda, Inc.  All Rights Reserved.
  * All Rights Reserved.
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
@@ -95,7 +96,7 @@ main(
     dle_t *dle;
     int level;
     GSList *errlist;
-    level_t *alevel;
+    am_level_t *alevel;
 
     if (argc > 1 && argv && argv[1] && g_str_equal(argv[1], "--version")) {
        printf("selfcheck-%s\n", VERSION);
@@ -260,7 +261,7 @@ main(
        if (ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
            goto err;                           /* bad level */
        }
-       alevel = g_new0(level_t, 1);
+       alevel = g_new0(am_level_t, 1);
        alevel->level = level;
        dle->levellist = g_slist_append(dle->levellist, alevel);
        skip_integer(s, ch);
@@ -1137,8 +1138,8 @@ check_overall(void)
        check_file(COMPRESS_PATH, X_OK);
 
     if (need_dump || need_xfsdump ) {
-       if (check_file_exist("/etc/dumpdates")) {
-           check_file("/etc/dumpdates",
+       if (check_file_exist("/var/lib/dumpdates")) {
+           check_file("/var/lib/dumpdates",
 #ifdef USE_RUNDUMP
                       F_OK
 #else
@@ -1148,15 +1149,15 @@ check_overall(void)
        } else {
 #ifndef USE_RUNDUMP
            if (access("/etc", R_OK|W_OK) == -1) {
-               g_printf(_("ERROR [dump will not be able to create the /etc/dumpdates file: %s]\n"), strerror(errno));
+               g_printf(_("ERROR [dump will not be able to create the /var/lib/dumpdates file: %s]\n"), strerror(errno));
            }
 #endif
        }
     }
 
     if (need_vdump) {
-       if (check_file_exist("/etc/vdumpdates")) {
-            check_file("/etc/vdumpdates", F_OK);
+       if (check_file_exist("/var/lib/vdumpdates")) {
+            check_file("/var/lib/vdumpdates", F_OK);
        }
     }
 
@@ -1168,6 +1169,7 @@ check_overall(void)
     check_space(AMANDA_DBGDIR, (off_t)64);     /* for amandad i/o */
 #endif
 
+    check_space("/var/lib", (off_t)64);                /* for /var/lib/dumpdates writing */
     check_space("/etc", (off_t)64);            /* for /etc/dumpdates writing */
     }
 }
@@ -1232,8 +1234,7 @@ print_platform(void)
        FILE *release = fopen("/etc/lsb-release", "r");
        distro = "Ubuntu";
        if (release) {
-           char *result;
-           while ((result = fgets(line, 1024, release))) {
+           while (fgets(line, 1024, release)) {
                if (strstr(line, "DESCRIPTION")) {
                    platform = strchr(line, '=');
                    if (platform) platform++;
@@ -1280,8 +1281,8 @@ print_platform(void)
                    if (result) {
                        platform = line;
                    }
+                   fclose(release);
                }
-               fclose(release);
            }
            amfree(uname);
        }